Skip to content

Commit 3b558d4

Browse files
author
Skyler Shaw
authored
Merge pull request #240 from intercom/skylerwshaw/patch_cordova_metaData_removal_bug
Fixup removing dependency on PackageManager metadata
2 parents d1c7aa4 + 08ddb87 commit 3b558d4

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Example/package-lock.json

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

intercom-plugin/src/android/IntercomBridge.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,13 @@ private void setUpIntercom() {
8080
}
8181
}
8282

83-
ApplicationInfo app = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
84-
Bundle bundle = app.metaData;
85-
8683
//Get app credentials from config.xml or the app bundle if they can't be found
87-
String apiKey = IntercomBridge.this.preferences.getString("intercom-android-api-key", bundle.getString("intercom_api_key"));
88-
String appId = IntercomBridge.this.preferences.getString("intercom-app-id", bundle.getString("intercom_app_id"));
84+
String apiKey = IntercomBridge.this.preferences.getString("intercom-android-api-key", "");
85+
String appId = IntercomBridge.this.preferences.getString("intercom-app-id", "");
8986

9087
Intercom.initialize(IntercomBridge.this.cordova.getActivity().getApplication(), apiKey, appId);
9188
} catch (Exception e) {
92-
Log.e("Intercom-Cordova", "ERROR: Something went wrong when initializing Intercom. Have you set your APP_ID and ANDROID_API_KEY?");
89+
Log.e("Intercom-Cordova", "ERROR: Something went wrong when initializing Intercom. Have you set your APP_ID and ANDROID_API_KEY?", e);
9390
}
9491
}
9592

0 commit comments

Comments
 (0)