Skip to content

Commit 31c0879

Browse files
authored
Merge pull request #274 from intercom/nicolette/bump-cordova-ios-android-versions
Update to cordova-android 8.0.0 and cordova-ios 5.0.0, remove GCM
2 parents e8a9dcc + 26b5750 commit 31c0879

File tree

8 files changed

+22
-41
lines changed

8 files changed

+22
-41
lines changed

Example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Before you run your app, you'll need to add your Intercom **AppID** and **API Ke
2020
<preference name="intercom-android-api-key" value="YOUR_ANDROID_API_KEY"/>
2121
```
2222

23-
If you want to enable Android FCM/GCM push notifications copy your `google-services.json` file into the `Example/` folder add this line to `config.xml`:
23+
If you want to enable Android FCM push notifications copy your `google-services.json` file into the `Example/` folder add this line to `config.xml`:
2424
```xml
2525
<preference name="intercom-android-push-type" value="FCM"/>
2626
```

Example/config.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
<splash src="www/img/launch/Default@2x~universal~anyany.png" />
4444
</platform>
4545
<preference name="intercom-app-id" value="YOUR_APP_ID" />
46-
<preference name="intercom-ios-api-key" value="YOU_IOS_API_KEY" />
46+
<preference name="intercom-ios-api-key" value="YOUR_IOS_API_KEY" />
4747
<preference name="intercom-android-api-key" value="YOUR_ANDROID_API_KEY" />
4848
<plugin name="cordova-plugin-whitelist" spec="1.0.0" />
49-
<engine name="ios" spec="^4.5.4" />
50-
<engine name="android" spec="~7.1.4" />
49+
<engine name="ios" spec="^5.0.0" />
50+
<engine name="android" spec="~8.0.0" />
5151
</widget>

Example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
}
1313
},
1414
"dependencies": {
15-
"cordova-android": "^7.1.4",
16-
"cordova-ios": "^4.5.4",
15+
"cordova-android": "^8.0.0",
16+
"cordova-ios": "^5.0.0",
1717
"cordova-plugin-whitelist": "^1.0.0"
1818
}
1919
}

intercom-plugin/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
"engines": [
2424
{
2525
"name": "cordova",
26-
"version": ">=7.1.0"
26+
"version": ">=9.0.0"
2727
},
2828
{
2929
"name": "cordova-android",
30-
"version": ">=7.0.0"
30+
"version": ">=8.0.0"
3131
},
3232
{
3333
"name": "cordova-ios",
34-
"version": ">=4.5.4"
34+
"version": ">=5.0.0"
3535
}
3636
],
3737
"author": "Intercom",

intercom-plugin/plugin.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<keywords>intercom,intercom-cordova</keywords>
99

1010
<engines>
11-
<engine name="cordova" version=">=7.1.0" />
12-
<engine name="cordova-android" version=">=7.1.0" />
13-
<engine name="cordova-ios" version=">=4.5.4" />
11+
<engine name="cordova" version=">=9.0.0" />
12+
<engine name="cordova-android" version=">=8.0.0" />
13+
<engine name="cordova-ios" version=">=5.0.0" />
1414
</engines>
1515

1616
<js-module name="Intercom" src="www/intercom.js">
@@ -47,7 +47,7 @@
4747
</array>
4848
</config-file>
4949

50-
<framework src="Intercom" type="podspec" spec="~> 5.1.0" />
50+
<framework src="Intercom" type="podspec" spec="~> 5.4.0" />
5151
</platform>
5252

5353
<platform name="android">

intercom-plugin/src/android/IntercomBridge.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ private void setUpIntercom() {
6060
try {
6161
Context context = cordova.getActivity().getApplicationContext();
6262

63-
CordovaHeaderInterceptor.setCordovaVersion(context, "6.2.0");
63+
CordovaHeaderInterceptor.setCordovaVersion(context, "7.0.0");
6464

6565
switch (IntercomPushManager.getInstalledModuleType()) {
66-
case GCM: {
66+
case FCM: {
6767
String senderId = getSenderId(context);
6868

6969
if (senderId != null) {
70-
LumberMill.getLogger().d("Using GCM Sender ID: " + senderId);
70+
LumberMill.getLogger().d("Using FCM Sender ID: " + senderId);
7171
IntercomPushManager.cacheSenderId(context, senderId);
7272
}
7373
break;

intercom-plugin/src/android/intercom.gradle

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ repositories {
2828
}
2929

3030
dependencies {
31-
compile 'io.intercom.android:intercom-sdk-base:5.1.5'
32-
if (pushType == 'gcm') {
33-
compile 'io.intercom.android:intercom-sdk-gcm:5.1.5'
34-
} else if (pushType == 'fcm' || pushType == 'fcm-without-build-plugin') {
35-
compile 'com.google.firebase:firebase-messaging:11.+'
36-
compile 'io.intercom.android:intercom-sdk-fcm:5.1.5'
31+
compile 'io.intercom.android:intercom-sdk-base:5.+'
32+
if (pushType == 'fcm' || pushType == 'fcm-without-build-plugin') {
33+
compile 'com.google.firebase:firebase-messaging:17.+'
34+
compile 'io.intercom.android:intercom-sdk-fcm:5.+'
3735
}
3836
}
3937

@@ -44,24 +42,7 @@ task copyGoogleServices(type: Copy) {
4442
into '.'
4543
}
4644

47-
if (pushType == 'gcm') {
48-
try {
49-
def jsonFile = file(googleServicesJsonPath)
50-
def parsedJson = new groovy.json.JsonSlurper().parseText(jsonFile.text)
51-
def senderId = parsedJson.project_info.project_number
52-
53-
android {
54-
defaultConfig {
55-
resValue "string", "intercom_gcm_sender_id", senderId
56-
buildConfigField "String", 'INTERCOM_SENDER_ID', "\"${senderId}\""
57-
}
58-
}
59-
} catch (Exception e) {
60-
logger.error("Could not read sender ID from google-services.json, falling back to " +
61-
"`intercom-android-sender-id` preference:" + e.getMessage())
62-
}
63-
64-
} else if (pushType == 'fcm') {
45+
if (pushType == 'fcm') {
6546
tasks.copyGoogleServices.execute()
6647
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
6748
} else if (pushType == 'fcm-without-build-plugin') {

intercom-plugin/src/ios/IntercomBridge.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ + (void)setCordovaVersion:(NSString *)v;
99
@implementation IntercomBridge : CDVPlugin
1010

1111
- (void)pluginInitialize {
12-
[Intercom setCordovaVersion:@"6.2.0"];
12+
[Intercom setCordovaVersion:@"7.0.0"];
1313
#ifdef DEBUG
1414
[Intercom enableLogging];
1515
#endif

0 commit comments

Comments
 (0)