-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to latest Intercom SDK and resolve GCM crashing with custom hook
- Loading branch information
1 parent
cfb9bf7
commit 4594368
Showing
40 changed files
with
224 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Intercom android module for Intercom Android SDK version 1.1.11 | ||
### Intercom android module for Intercom Android SDK version 1.1.21 | ||
|
||
Integrate Intercom.io with Appcelerator. iOS module available here https://github.com/markive/TiIntercom . Tested with 5.1.1GA SDK | ||
|
||
|
@@ -47,7 +47,7 @@ exports.setDeviceToken = function(token, appicon /* 'device-token', Ti.App.Andro | |
``` | ||
|
||
### tiapp.xml changes for Android GCM support | ||
### IMPORTANT : tiapp.xml changes for Android GCM support | ||
``` | ||
<android xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<manifest> | ||
|
@@ -78,6 +78,53 @@ exports.setDeviceToken = function(token, appicon /* 'device-token', Ti.App.Andro | |
</android> | ||
``` | ||
|
||
### IMPORTANT : create hooks folder and intercom.js file in the module for Android GCM support | ||
You need to create a hooks folder with a .js file inside the module directory with the following contents. This makes sure the additional R values are added for intercom during compile. If someone can tell me how to update the ant build script to create this automatically in the compiled dist please let me know otherwise you need to do this manually after compile. | ||
|
||
Create the following file: | ||
|
||
FILE: /modules/android/ti.intercom.android/1.0.4/hooks/intercom.js | ||
``` | ||
exports.cliVersion = '>=3.X'; | ||
exports.init = function(logger, config, cli, appc) { | ||
cli.on('build.android.aapt', { | ||
pre : function(data, next) { | ||
var args = data.args[1]; | ||
if (args.indexOf('--auto-add-overlay') < 0) { | ||
args.push('--auto-add-overlay'); | ||
} | ||
var externalLibraries = [{ | ||
javaClass : 'io.intercom.android.sdk.gcm', | ||
resPath : '/Users/jerodfritz/Appcelerator/Prspctr/modules/android/ti.intercom.android/1.0.4/platform/android/gcm-res' | ||
}]; | ||
console.log("Add Intercom GCM External Libraries", JSON.stringify(externalLibraries)); | ||
// --extra-packages can be defined just once | ||
if (args.indexOf('--extra-packages') < 0) { | ||
args.push('--extra-packages'); | ||
args.push(''); | ||
} | ||
var namespaceIndex = args.indexOf('--extra-packages') + 1; | ||
externalLibraries.forEach(function(lib) { | ||
if (args[namespaceIndex].indexOf(lib.javaClass) < 0) { | ||
args[namespaceIndex].length && (args[namespaceIndex] += ':'); | ||
args[namespaceIndex] += lib.javaClass; | ||
} | ||
if (args.indexOf(lib.resPath) < 0) { | ||
args.push('-S'); | ||
args.push(lib.resPath); | ||
} | ||
}); | ||
next(null, data); | ||
} | ||
}); | ||
}; | ||
``` | ||
|
||
|
||
#### Author | ||
Jerod | ||
([email protected]) | ||
|
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
titanium.platform=/Users/jerodfritz/Library/Application Support/Titanium/mobilesdk/osx/5.1.1.GA/android | ||
titanium.platform=/Users/jerodfritz/Library/Application Support/Titanium/mobilesdk/osx/5.3.0.GA/android | ||
android.platform=/Applications/Android/platforms/android-23 | ||
google.apis=/Applications/Android/add-ons/addon-google_apis-google-23 | ||
android.ndk=/Applications/Android/ndk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"/Users/jerodfritz/Documents/Appcelerator_Studio_Workspace/tiintercomandroid/android/src/ti/intercom/android/TiintercomandroidModule.java" |
This file was deleted.
Oops, something went wrong.
Binary file renamed
BIN
+383 KB
android/lib/classes.jar → android/lib/intercom-sdk-base-classes.jar
100644 → 100755
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+580 Bytes
android/platform/android/gcm-res/drawable-hdpi-v4/intercomsdk_default_push.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+503 Bytes
android/platform/android/gcm-res/drawable-mdpi-v4/intercomsdk_default_push.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+975 Bytes
android/platform/android/gcm-res/drawable-xhdpi-v4/intercomsdk_default_push.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.16 KB
android/platform/android/gcm-res/drawable-xxhdpi-v4/intercomsdk_default_push.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<plurals name="intercomsdk_groupMessage"> | ||
<item quantity="one">"You have a new message"</item> | ||
<item quantity="other">"You have %d new messages"</item> | ||
</plurals> | ||
<string name="intercomsdk_groupExpandedTitle">New notifications</string> | ||
<string name="intercomsdk_groupTitle">New notifications</string> | ||
<string name="intercomsdk_push_title_format">%1$s from %2$s</string> | ||
</resources> |
Binary file added
BIN
+580 Bytes
android/platform/android/res/drawable-hdpi-v4/intercomsdk_default_push.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+503 Bytes
android/platform/android/res/drawable-mdpi-v4/intercomsdk_default_push.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+975 Bytes
android/platform/android/res/drawable-xhdpi-v4/intercomsdk_default_push.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.16 KB
android/platform/android/res/drawable-xxhdpi-v4/intercomsdk_default_push.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<integer name="google_play_services_version">7571000</integer> | ||
</resources> |
Oops, something went wrong.