@capacitor/push-notifications 4.0.2-nightly-77dc02f.0 → 4.0.2-nightly-5d1d5f5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ import android.app.NotificationManager;
5
5
  import android.content.Context;
6
6
  import android.content.Intent;
7
7
  import android.content.pm.ApplicationInfo;
8
+ import android.content.pm.PackageManager;
8
9
  import android.net.Uri;
9
10
  import android.os.Build;
10
11
  import android.os.Bundle;
@@ -219,9 +220,17 @@ public class PushNotificationsPlugin extends Plugin {
219
220
  String[] presentation = getConfig().getArray("presentationOptions");
220
221
  if (presentation != null) {
221
222
  if (Arrays.asList(presentation).contains("alert")) {
222
- ApplicationInfo applicationInfo = getContext().getApplicationInfo();
223
- Bundle bundle = applicationInfo.metaData;
223
+ Bundle bundle = null;
224
+ try {
225
+ ApplicationInfo applicationInfo = getContext()
226
+ .getPackageManager()
227
+ .getApplicationInfo(getContext().getPackageName(), PackageManager.GET_META_DATA);
228
+ bundle = applicationInfo.metaData;
229
+ } catch (PackageManager.NameNotFoundException e) {
230
+ e.printStackTrace();
231
+ }
224
232
  int pushIcon = android.R.drawable.ic_dialog_info;
233
+
225
234
  if (bundle != null && bundle.getInt("com.google.firebase.messaging.default_notification_icon") != 0) {
226
235
  pushIcon = bundle.getInt("com.google.firebase.messaging.default_notification_icon");
227
236
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/push-notifications",
3
- "version": "4.0.2-nightly-77dc02f.0",
3
+ "version": "4.0.2-nightly-5d1d5f5.0",
4
4
  "description": "The Push Notifications API provides access to native push notifications.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "77dc02fb829ad3479144368da16f9fff324f2706"
83
+ "gitHead": "5d1d5f5b514e44b2f517523cd3c80892f1b6c04e"
84
84
  }