Skip to content

Commit 62d425b

Browse files
committed
updating samples
1 parent 6028e95 commit 62d425b

File tree

18 files changed

+39
-119
lines changed

18 files changed

+39
-119
lines changed

samples/.DS_Store

0 Bytes
Binary file not shown.

samples/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ This contains sample apps of ways to integrate and test the integration of the A
55
## Android Studio sample app
66
### Setting Up
77
This is a sample application to help with Intercom integration in Android Studio apps
8-
You will need to visit https://developers.google.com/cloud-messaging/android/client to download your configuration file. Use the following 'io.intercom.gcmsample' as the package name and then copy the file into gcmsample directory.
9-
You will need to add your Api Key, App Id in the SampleApplication file
8+
You will need to add your Api Key and App Id to the SampleApplication
109
You will also need to add either an email or user id (THIS USER WILL BE REGISTERED IN YOUR APP)
1110
If you have enabled secure mode you will need to provide hmac and data
1211
### Usage

samples/intercom-androidstudio-sample/.idea/compiler.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/intercom-androidstudio-sample/.idea/gradle.xml

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/intercom-androidstudio-sample/.idea/misc.xml

Lines changed: 1 addition & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/intercom-androidstudio-sample/.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

samples/intercom-androidstudio-sample/androidstudiosample/build.gradle

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 22
5-
buildToolsVersion "22.0.1"
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.2"
66

77
defaultConfig {
88
applicationId "io.intercom.androidstudiosample"
99
minSdkVersion 15
10-
targetSdkVersion 22
10+
targetSdkVersion 23
1111
versionCode 1
1212
versionName "1.0"
1313
}
@@ -27,9 +27,7 @@ repositories {
2727

2828
dependencies {
2929
compile fileTree(dir: 'libs', include: ['*.jar'])
30-
compile 'com.android.support:appcompat-v7:22.2.0'
30+
compile 'com.android.support:appcompat-v7:23.2.0'
3131

32-
compile('io.intercom.android:intercom-sdk:1.1.1@aar') {
33-
transitive = true
34-
}
32+
compile('io.intercom.android:intercom-sdk-base:1.1.16@aar')
3533
}

samples/intercom-androidstudio-sample/androidstudiosample/src/main/java/io/intercom/androidstudiosample/IntercomService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public IBinder onBind(Intent arg0) {
2121

2222
@Override public void onCreate() {
2323
super.onCreate();
24-
Intercom.client().registerIdentifiedUser(new Registration().withEmail("[email protected]"));
2524
Log.d("SERVICE", "onCreate called");
2625
}
2726

@@ -30,4 +29,4 @@ public void onDestroy() {
3029
super.onDestroy();
3130
Log.d("SERVICE", "onDestroy called");
3231
}
33-
}
32+
}

samples/intercom-androidstudio-sample/androidstudiosample/src/main/java/io/intercom/androidstudiosample/MainActivity.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ protected void onCreate(Bundle savedInstanceState) {
6969

7070

7171
@Override public void onClick(View v) {
72-
//if you have provided a user id register user with it, otherwise we will use email
72+
Registration registration = Registration.create();
7373
if (!TextUtils.isEmpty(YOUR_USER_ID)) {
74-
Intercom.client().registerIdentifiedUser(new Registration().withUserId(YOUR_USER_ID));
75-
} else if (!TextUtils.isEmpty(YOUR_EMAIL)) {
76-
Intercom.client().registerIdentifiedUser(new Registration().withEmail(YOUR_EMAIL));
77-
} else {
78-
Log.d("REGISTRATION_ERROR", "No email or user id");
74+
registration.withUserId(YOUR_USER_ID);
7975
}
76+
if (!TextUtils.isEmpty(YOUR_EMAIL)) {
77+
registration.withEmail(YOUR_EMAIL);
78+
}
79+
Intercom.client().registerIdentifiedUser(registration);
8080

8181
registerButton.setEnabled(false);
8282
}

samples/intercom-androidstudio-sample/androidstudiosample/src/main/java/io/intercom/androidstudiosample/SampleApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
*/
1111
public class SampleApplication extends Application {
1212
//CHANGE THESE VALUES
13-
private final String YOUR_API_KEY = "<YOUR_API_KEY>";
14-
private final String YOUR_APP_ID = "<YOUR_APP_ID>";
13+
private static final String YOUR_API_KEY = "<INTERCOM_API_KEY>";
14+
private static final String YOUR_APP_ID = "<INTERCOM_APP_ID>";
1515

1616
@Override public void onCreate() {
1717
super.onCreate();

0 commit comments

Comments
 (0)