Skip to content

Commit

Permalink
Add namespace to provider authority to prevent crashes on Android. (k…
Browse files Browse the repository at this point in the history
…atzer#1772)

* Add namespace to provider authority to prevent crashes on Android.
See katzer#1664

* Comment out android-sdk requirement since it's not being applied correctly.
See katzer#1561

* oreo bug fix, no smallIcon set in notification (katzer#1792)

* Update AssetUtil.java

Removing Resources.getSystem() to get resource ID because in android 8.1 (physical device) it fire an exception with the DEFALUT_ICON (res://icon) if no smallIcon is set in the notification schedule.
Changed also Options.java for small icon fallback

* Update Options.java

Removed resId = context.getApplicationInfo().icon
The application icon is set always and it is not able to select the resId = android.R.drawable.ic_popup_reminder. This is always set (API 1) and not showing ugly as app icon (notification small icon should be a silhouette)
  • Loading branch information
dpa99c authored and katzer committed Oct 7, 2019
1 parent 02238ee commit caff55e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<engine name="cordova-plugman" version=">=4.3.0" />
<engine name="cordova-android" version=">=6.3.0" />
<engine name="cordova-windows" version=">=4.2.0" />
<engine name="android-sdk" version=">=26" />
<!-- <engine name="android-sdk" version=">=26" /> -->
<engine name="apple-ios" version=">=10.0.0" />
</engines>

Expand Down Expand Up @@ -103,7 +103,7 @@
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<provider
android:name="de.appplant.cordova.plugin.notification.util.AssetProvider"
android:authorities="${applicationId}.provider"
android:authorities="${applicationId}.localnotifications.provider"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
Expand Down
2 changes: 1 addition & 1 deletion src/android/notification/util/AssetUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ private File getTmpFile (String name) {
*/
private Uri getUriFromFile(File file) {
try {
String authority = context.getPackageName() + ".provider";
String authority = context.getPackageName() + "localnotifications.provider";
return AssetProvider.getUriForFile(context, authority, file);
} catch (IllegalArgumentException e) {
e.printStackTrace();
Expand Down

0 comments on commit caff55e

Please sign in to comment.