From 34761f9a121a9048bdff9778276e663ba57b8ec4 Mon Sep 17 00:00:00 2001 From: Conor O'Donnell Date: Wed, 1 Nov 2017 17:10:31 +0000 Subject: [PATCH] Update to 4.1.0 --- CHANGELOG.md | 7 +++++++ Example/www/index.html | 2 +- Example/www/js/index.js | 8 ++++---- README.md | 2 +- intercom-plugin/package.json | 2 +- intercom-plugin/plugin.xml | 4 ++-- intercom-plugin/src/android/IntercomBridge.java | 6 +++--- intercom-plugin/src/android/intercom.gradle | 8 ++++---- intercom-plugin/src/ios/IntercomBridge.h | 2 +- intercom-plugin/src/ios/IntercomBridge.m | 6 +++--- intercom-plugin/www/intercom.js | 6 +++++- 11 files changed, 32 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7eed3f..818d9ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Intercom for Cordova/PhoneGap +## 4.1.0 (2017-11-02) + +* Updated Intercom for Android to 4.1.x +* Updated Intercom for iOS to 4.1.x +* Added `intercom.logout()`. +* Added diagnostic messages for Android build errors. + ## 4.0.0 (2017-08-29) * Updated Intercom for Android to 4.0.1 diff --git a/Example/www/index.html b/Example/www/index.html index 2c046fc..1b89039 100644 --- a/Example/www/index.html +++ b/Example/www/index.html @@ -12,7 +12,7 @@

-

+

diff --git a/Example/www/js/index.js b/Example/www/js/index.js index 7a15e23..f36415d 100644 --- a/Example/www/js/index.js +++ b/Example/www/js/index.js @@ -46,8 +46,8 @@ var app = { app.login(); }, false); - document.getElementById("logut-btn").addEventListener("click", function(){ - intercom.reset(); + document.getElementById("logout-btn").addEventListener("click", function(){ + intercom.logout(); var storage = window.localStorage; storage.removeItem("email"); app.configureViewForLoggedOutUser(); @@ -81,13 +81,13 @@ var app = { }, configureViewForLoggedInUser: function() { - document.getElementById("logut-btn").style.visibility = 'visible'; + document.getElementById("logout-btn").style.visibility = 'visible'; document.getElementById("open-intercom-btn").style.visibility = 'visible'; document.getElementById("login-btn").style.visibility = 'hidden'; }, configureViewForLoggedOutUser: function() { - document.getElementById("logut-btn").style.visibility = 'hidden'; + document.getElementById("logout-btn").style.visibility = 'hidden'; document.getElementById("open-intercom-btn").style.visibility = 'hidden'; document.getElementById("login-btn").style.visibility = 'visible'; } diff --git a/README.md b/README.md index cc9dbf5..02db50a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ cordova plugin add cordova-plugin-intercom To add the plugin to your PhoneGap app, add the following to your `config.xml`: ```xml - + ``` ### Ionic diff --git a/intercom-plugin/package.json b/intercom-plugin/package.json index 03dab9a..547c506 100644 --- a/intercom-plugin/package.json +++ b/intercom-plugin/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-intercom", - "version": "4.0.0", + "version": "4.1.0", "description": "Official Cordova/PhoneGap plugin for Intercom", "cordova": { "id": "cordova-plugin-intercom", diff --git a/intercom-plugin/plugin.xml b/intercom-plugin/plugin.xml index 3c66528..683669e 100644 --- a/intercom-plugin/plugin.xml +++ b/intercom-plugin/plugin.xml @@ -1,5 +1,5 @@ - + Intercom Intercom MIT License @@ -47,7 +47,7 @@ - + diff --git a/intercom-plugin/src/android/IntercomBridge.java b/intercom-plugin/src/android/IntercomBridge.java index 0ae1850..b864132 100644 --- a/intercom-plugin/src/android/IntercomBridge.java +++ b/intercom-plugin/src/android/IntercomBridge.java @@ -68,7 +68,7 @@ private void setUpIntercom() { try { Context context = IntercomBridge.this.cordova.getActivity().getApplicationContext(); - CordovaHeaderInterceptor.setCordovaVersion(context, "4.0.0"); + CordovaHeaderInterceptor.setCordovaVersion(context, "4.1.0"); switch (IntercomPushManager.getInstalledModuleType()) { case GCM: { @@ -117,9 +117,9 @@ private enum Action { callbackContext.success(); } }, - reset { + logout { @Override void performAction(JSONArray args, CallbackContext callbackContext, CordovaInterface cordova) { - Intercom.client().reset(); + Intercom.client().logout(); callbackContext.success(); } }, diff --git a/intercom-plugin/src/android/intercom.gradle b/intercom-plugin/src/android/intercom.gradle index f1410e2..479a6ae 100644 --- a/intercom-plugin/src/android/intercom.gradle +++ b/intercom-plugin/src/android/intercom.gradle @@ -15,7 +15,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' if (pushType == 'fcm') { - classpath 'com.google.gms:google-services:3.0.0' + classpath 'com.google.gms:google-services:3.1.0' } } } @@ -26,12 +26,12 @@ repositories { } dependencies { - compile 'io.intercom.android:intercom-sdk-base:4.0.+' + compile 'io.intercom.android:intercom-sdk-base:4.1.+' if (pushType == 'gcm') { - compile 'io.intercom.android:intercom-sdk-gcm:4.0.+' + compile 'io.intercom.android:intercom-sdk-gcm:4.1.+' } else if (pushType == 'fcm') { compile 'com.google.firebase:firebase-messaging:11.+' - compile 'io.intercom.android:intercom-sdk-fcm:4.0.+' + compile 'io.intercom.android:intercom-sdk-fcm:4.1.+' } } diff --git a/intercom-plugin/src/ios/IntercomBridge.h b/intercom-plugin/src/ios/IntercomBridge.h index 58aeae9..f1baaea 100644 --- a/intercom-plugin/src/ios/IntercomBridge.h +++ b/intercom-plugin/src/ios/IntercomBridge.h @@ -6,7 +6,7 @@ - (void)registerIdentifiedUser:(CDVInvokedUrlCommand*)command; - (void)registerUnidentifiedUser:(CDVInvokedUrlCommand*)command; -- (void)reset:(CDVInvokedUrlCommand*)command; +- (void)logout:(CDVInvokedUrlCommand*)command; - (void)setUserHash:(CDVInvokedUrlCommand*)command; diff --git a/intercom-plugin/src/ios/IntercomBridge.m b/intercom-plugin/src/ios/IntercomBridge.m index 15580bd..d74d8a4 100644 --- a/intercom-plugin/src/ios/IntercomBridge.m +++ b/intercom-plugin/src/ios/IntercomBridge.m @@ -9,7 +9,7 @@ + (void)setCordovaVersion:(NSString *)v; @implementation IntercomBridge : CDVPlugin - (void)pluginInitialize { - [Intercom setCordovaVersion:@"4.0.0"]; + [Intercom setCordovaVersion:@"4.1.0"]; #ifdef DEBUG [Intercom enableLogging]; #endif @@ -51,8 +51,8 @@ - (void)registerUnidentifiedUser:(CDVInvokedUrlCommand*)command { [self sendSuccess:command]; } -- (void)reset:(CDVInvokedUrlCommand*)command { - [Intercom reset]; +- (void)logout:(CDVInvokedUrlCommand*)command { + [Intercom logout]; [self sendSuccess:command]; } diff --git a/intercom-plugin/www/intercom.js b/intercom-plugin/www/intercom.js index c90a560..762188a 100644 --- a/intercom-plugin/www/intercom.js +++ b/intercom-plugin/www/intercom.js @@ -8,7 +8,11 @@ var intercom = { }, reset: function(success, error) { - cordova.exec(success, error, 'Intercom', 'reset', []); + cordova.exec(success, error, 'Intercom', 'logout', []); + }, + + logout: function(success, error) { + cordova.exec(success, error, 'Intercom', 'logout', []); }, setSecureMode: function(secureHash, secureData, success, error) {