Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Catch the resource not found execption when 'gcm_defaultSenderId' is …
Browse files Browse the repository at this point in the history
…not defined, for whatever reason, so that the app does not crash. (#1923)
  • Loading branch information
ben-8409 authored and macdonst committed Sep 1, 2017
1 parent cd3cd2b commit 7d22655
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/android/com/adobe/phonegap/push/PushPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.app.NotificationManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.Log;

Expand Down Expand Up @@ -98,6 +99,10 @@ public void run() {
} catch (IOException e) {
Log.e(LOG_TAG, "execute: Got IO Exception " + e.getMessage());
callbackContext.error(e.getMessage());
} catch (Resources.NotFoundException e) {

Log.e(LOG_TAG, "execute: Got Resources NotFoundException " + e.getMessage());
callbackContext.error(e.getMessage());
}

if (jo != null) {
Expand Down

0 comments on commit 7d22655

Please sign in to comment.