Releases: andrehtissot/cordova-plugin-fcm-with-dependecy-updated
Device token format fixed for iOS 13
As mentioned in several posts like https://onesignal.com/blog/ios-13-introduces-4-breaking-changes-to-notifications/, the way the device token was retrieve does not work in the new iOS 13.
Now, thanks to @rich186, the workaround is implemented and the plugin should continue to work as expected.
Added FCMPlugin.clearAllNotifications()
Changelog
Added FCMPlugin.clearAllNotifications()
Older notifications can be cleared from notification center. Works on both IOS and Android.
//FCMPlugin.clearAllNotifications( successCallback(msg), errorCallback(err) );
FCMPlugin.clearAllNotifications();
Type definition now exported
Now the interfaces FCMPlugin and INotificationData defined in src/FCMPlugin.d.ts
are exported.
Cocoapods, IOS dependencies update, and FCMPlugin.getAPNSToken
Changelog
-
Replaced internal dependencies in favour of dependencies from cocoapods to avoid conflict with other, newer, firebase plugins;
-
FIRApp.configure
execution is avoided if it has already been ran by another plugin; -
Added
FCMPlugin.d.ts
for type defition; -
For the IOS, APNS token can now be retrieved by the new method:
FCMPlugin.getAPNSToken(
function(token) {
console.info("Retrieved token: "+token)
},
function(error) {
console.error(error);
}
);
Special thanks to bhargav (@bhargavas12) for requesting the feature and helping testing it.
Added hasPermission method.
Useful for IOS. On android, it will always return true
.
FCMPlugin.hasPermission(function(doesIt){
// doesIt === true => yes, push was allowed
// doesIt === false => nope, push will not be available
// doesIt === null => still not answered, recommended checking again later
if(doesIt) {
haveFun();
}
});
Thanks for the inspiration Patrick Schubert (@Twisterking)
Fixed getToken crashing bug
- Fixed bug when get token error occurs (PR #9 );
- Upgraded GRADLE_TOOLS_VERSION and GOOGLE_SERVICES_VERSION versions (PR #9 ).
Thanks to @florian-diatelic for the fix.
Updated FCM API to 18.0.0+
This new version includes the many improvements written by Felipe Michel (@mfdeveloper).
Android
- Refactor to use FCM
com.google.firebase:firebase-messaging
version18.0.0
+ - Refactor to can use this plugin directly from Android Native (without a Cordova Webview). This is great to call
getToken()
from a Android native project, for example. - Added a example project under
android
folder, and deliver this plugin like a dependency with https://jitpack.io FCMPlugin.gradle
improvements to allow use this plugin withcordova-android
versions6.3.0
and8.0.0
+. These changes was required after upgrade thefirebase-messaging
dependency.
IOS
- Added https://cocoapods.org support