Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marshall86 patch ios #93

Open
wants to merge 33 commits into
base: feat/v4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
77df567
Add display articles methods
Jul 26, 2022
353f77f
refactor(): handle user ids passed as integer
ramikhafagi96 Aug 18, 2022
62fc4ac
fix(): cast userId to type String
ramikhafagi96 Aug 18, 2022
133b5a0
fix(): add exception to method
ramikhafagi96 Aug 18, 2022
2a81d29
refactor(): import JSONException
ramikhafagi96 Aug 18, 2022
00d879d
Merge pull request #67 from capacitor-community/feat/v4
stewones Sep 28, 2022
49e263b
Merge pull request #68 from cartona/handle-user-ids-passed-as-integer
stewones Sep 28, 2022
8adffd6
Merge pull request #64 from camdjn/master
stewones Sep 28, 2022
1ad877a
fix: upgrade ios api to intercom 13
stewones Sep 28, 2022
8cf4bd1
docs: add @ramikhafagi96 as a contributor
stewones Sep 28, 2022
f799b63
docs: add @rdlabo as a contributor
stewones Sep 28, 2022
b29382d
docs: add @camdjn as a contributor
stewones Sep 28, 2022
d6cc403
chore: bump to v4
stewones Sep 28, 2022
50f18ff
fix: Cann't resolve io.intercom.android:intercom-sdk
scr2em Oct 31, 2022
06cb336
refactor: dynamic version import for intercom sdk
scr2em Nov 8, 2022
3d26999
Merge pull request #74 from scr2em/patch-1
stewones Nov 9, 2022
dac4f46
docs: add @scr2em as a contributor
stewones Nov 9, 2022
eddf514
chore(release): 4.0.1
stewones Nov 9, 2022
20a5f90
Replace "get" call, which throws JSONException when the key doesn't e…
shark404 Nov 11, 2022
b09ad1f
Merge pull request #76 from SafesiteHQ/bug/android-no-userid
stewones Dec 14, 2022
7b82c44
docs: add @shark404 as a contributor
stewones Dec 14, 2022
9af12ee
chore(release): 4.0.2
stewones Dec 14, 2022
92abbe5
IntercomUserUpdateOptions doesnt require customAttributes to be a req…
pavloPyrig0 Jan 12, 2023
3e2b3d5
feature: add inapp ability to change clients
dupiesdupreez Feb 13, 2023
adf4b9f
Upgrade to Capacitor v5
cwoebker May 13, 2023
7cc73c6
docs: add @cwoebker as a contributor
cwoebker May 13, 2023
d8077f5
Merge pull request #79 from pavloPyrig0/patch-1
stewones May 18, 2023
070d6fb
Merge pull request #82 from dupiesdupreez/master
stewones May 18, 2023
27ec65a
Merge pull request #86 from cwoebker/feature/capacitor-v5
stewones May 18, 2023
be62968
docs: add @pavloPyrig0 as a contributor
stewones May 18, 2023
18410b0
docs: add @dupiesdupreez as a contributor
stewones May 18, 2023
8137e5c
chore(release): 5.0.0
stewones May 18, 2023
5b0eaa8
Update IntercomPlugin.swift
marshall86 Jun 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,79 @@
"code",
"maintenance"
]
},
{
"login": "ramikhafagi96",
"name": "Rami Khafagi",
"avatar_url": "https://avatars.githubusercontent.com/u/38646828?v=4",
"profile": "https://github.com/ramikhafagi96",
"contributions": [
"code"
]
},
{
"login": "rdlabo",
"name": "Masahiko Sakakibara",
"avatar_url": "https://avatars.githubusercontent.com/u/9690024?v=4",
"profile": "https://rdlabo.jp/",
"contributions": [
"maintenance"
]
},
{
"login": "camdjn",
"name": "Dejardin Camille",
"avatar_url": "https://avatars.githubusercontent.com/u/7116085?v=4",
"profile": "https://github.com/camdjn",
"contributions": [
"code"
]
},
{
"login": "scr2em",
"name": "Mohamed Abdelgwad",
"avatar_url": "https://avatars.githubusercontent.com/u/4671486?v=4",
"profile": "https://scr2em.github.io/portfolio/",
"contributions": [
"maintenance"
]
},
{
"login": "shark404",
"name": "Nathan",
"avatar_url": "https://avatars.githubusercontent.com/u/4898049?v=4",
"profile": "https://github.com/shark404",
"contributions": [
"maintenance"
]
},
{
"login": "cwoebker",
"name": "Cecil Wöbker",
"avatar_url": "https://avatars.githubusercontent.com/u/885085?v=4",
"profile": "https://cwoebker.com/",
"contributions": [
"code",
"maintenance"
]
},
{
"login": "pavloPyrig0",
"name": "Pavlo Pyrig",
"avatar_url": "https://avatars.githubusercontent.com/u/10965335?v=4",
"profile": "https://github.com/pavloPyrig0",
"contributions": [
"code"
]
},
{
"login": "dupiesdupreez",
"name": "Ruan",
"avatar_url": "https://avatars.githubusercontent.com/u/6910085?v=4",
"profile": "https://github.com/dupiesdupreez",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [5.0.0](https://github.com/capacitor-community/intercom/compare/v4.0.2...v5.0.0) (2023-05-18)

### [4.0.2](https://github.com/capacitor-community/intercom/compare/v4.0.1...v4.0.2) (2022-12-14)

### [4.0.1](https://github.com/capacitor-community/intercom/compare/v4.0.0...v4.0.1) (2022-11-09)


### Bug Fixes

* Cann't resolve io.intercom.android:intercom-sdk ([50f18ff](https://github.com/capacitor-community/intercom/commit/50f18ffc02281a379b6100bccae1c17bd5958e2e))

### [3.0.3](https://github.com/capacitor-community/intercom/compare/v3.0.1...v3.0.3) (2022-05-10)


Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<a href="https://www.npmjs.com/package/@capacitor-community/intercom"><img src="https://img.shields.io/npm/dw/@capacitor-community/intercom?style=flat-square" /></a>
<a href="https://www.npmjs.com/package/@capacitor-community/intercom"><img src="https://img.shields.io/npm/v/@capacitor-community/intercom?style=flat-square" /></a>
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<a href="#contributors"><img src="https://img.shields.io/badge/all%20contributors-9-orange?style=flat-square" /></a>
<a href="#contributors"><img src="https://img.shields.io/badge/all%20contributors-17-orange?style=flat-square" /></a>
<!-- ALL-CONTRIBUTORS-BADGE:END -->
</p>

Expand Down Expand Up @@ -216,6 +216,16 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<tr>
<td align="center"><a href="https://github.com/Jealvia"><img src="https://avatars.githubusercontent.com/u/28424830?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Jealvia</b></sub></a><br /><a href="#maintenance-Jealvia" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://adamduren.com/"><img src="https://avatars.githubusercontent.com/u/581097?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Adam Duren</b></sub></a><br /><a href="https://github.com/capacitor-community/intercom/commits?author=adamduren" title="Code">💻</a> <a href="#maintenance-adamduren" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/ramikhafagi96"><img src="https://avatars.githubusercontent.com/u/38646828?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Rami Khafagi</b></sub></a><br /><a href="https://github.com/capacitor-community/intercom/commits?author=ramikhafagi96" title="Code">💻</a></td>
<td align="center"><a href="https://rdlabo.jp/"><img src="https://avatars.githubusercontent.com/u/9690024?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Masahiko Sakakibara</b></sub></a><br /><a href="#maintenance-rdlabo" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/camdjn"><img src="https://avatars.githubusercontent.com/u/7116085?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Dejardin Camille</b></sub></a><br /><a href="https://github.com/capacitor-community/intercom/commits?author=camdjn" title="Code">💻</a></td>
<td align="center"><a href="https://scr2em.github.io/portfolio/"><img src="https://avatars.githubusercontent.com/u/4671486?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Mohamed Abdelgwad</b></sub></a><br /><a href="#maintenance-scr2em" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/shark404"><img src="https://avatars.githubusercontent.com/u/4898049?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Nathan</b></sub></a><br /><a href="#maintenance-shark404" title="Maintenance">🚧</a></td>
</tr>
<tr>
<td align="center"><a href="https://cwoebker.com/"><img src="https://avatars.githubusercontent.com/u/885085?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Cecil Wöbker</b></sub></a><br /><a href="https://github.com/capacitor-community/intercom/commits?author=cwoebker" title="Code">💻</a> <a href="#maintenance-cwoebker" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/pavloPyrig0"><img src="https://avatars.githubusercontent.com/u/10965335?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Pavlo Pyrig</b></sub></a><br /><a href="https://github.com/capacitor-community/intercom/commits?author=pavloPyrig0" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/dupiesdupreez"><img src="https://avatars.githubusercontent.com/u/6910085?v=4?s=75" width="75px;" alt=""/><br /><sub><b>Ruan</b></sub></a><br /><a href="https://github.com/capacitor-community/intercom/commits?author=dupiesdupreez" title="Code">💻</a></td>
</tr>
</table>

Expand Down
21 changes: 11 additions & 10 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ext {
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
intercomSdkVersion = project.hasProperty('intercomSdkVersion') ? rootProject.ext.intercomSdkVersion : '12.5.0'
}

buildscript {
Expand All @@ -11,17 +12,18 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.android.tools.build:gradle:8.0.0'
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
namespace "com.getcapacitor.community.intercom.intercom"
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
defaultConfig {
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -36,14 +38,13 @@ android {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

repositories {
google()
mavenCentral()
mavenCentral()
}

Expand All @@ -55,6 +56,6 @@ dependencies {
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation 'io.intercom.android:intercom-sdk:10.+'
implementation "io.intercom.android:intercom-sdk:$intercomSdkVersion"
implementation 'com.google.firebase:firebase-messaging:20.2.+'
}
3 changes: 1 addition & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ org.gradle.jvmargs=-Xmx1536m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.getcapacitor.community.intercom.intercom">
>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import com.getcapacitor.annotation.CapacitorPlugin;
import com.getcapacitor.annotation.Permission;

import org.json.JSONException;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
Expand All @@ -34,6 +36,17 @@ public void load() {
// load parent
super.load();
}

@PluginMethod()
public void loadWithKeys(PluginCall call) {
String appId = call.getString("appId", "NO_APP_ID_PASSED");
String apiKey = call.getString("apiKeyAndroid", "NO_API_KEY_PASSED");

Intercom.initialize(this.getActivity().getApplication(), apiKey, appId);

// load parent
super.load();
}

@Override
public void handleOnStart() {
Expand All @@ -51,7 +64,7 @@ public void run() {
@PluginMethod
public void registerIdentifiedUser(PluginCall call) {
String email = call.getString("email");
String userId = call.getString("userId");
String userId = call.getData().getString("userId");

Registration registration = new Registration();

Expand Down Expand Up @@ -218,6 +231,13 @@ public void receivePush(PluginCall call) {
}
}

@PluginMethod
public void displayArticle(PluginCall call) {
String articleId = call.getString("articleId");
Intercom.client().displayArticle(articleId);
call.resolve();
}

private void setUpIntercom() {
try {
// get config
Expand Down
2 changes: 2 additions & 0 deletions ios/Plugin/IntercomPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Define the plugin using the CAP_PLUGIN Macro, and
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
CAP_PLUGIN(IntercomPlugin, "Intercom",
CAP_PLUGIN_METHOD(loadWithKeys, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(registerIdentifiedUser, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(registerUnidentifiedUser, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(updateUser, CAPPluginReturnPromise);
Expand All @@ -20,4 +21,5 @@
CAP_PLUGIN_METHOD(displayCarousel, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(setUserHash, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(setBottomPadding, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(displayArticle, CAPPluginReturnPromise);
)
Loading