Posts

Showing posts with the label Firebase Cloud Messaging

Can We Do Web Push Notifications In Chrome Without Using GCM/FCM?

Answer : No, it is not possible to use another push service. In Firefox, you can do it by modifying the dom.push.serverURL preference, but obviously you'd need privileged access to alter the value of the pref. There are third-party services that you can use to implement push notifications, but they will use the Web Push API under the hood (so Autopush on Firefox, GCM/FCM on Chrome). Yes. Using VAPID spec and service worker you can use web push notifications without FCM/GCM. For more information please look into below google docs. https://developers.google.com/web/fundamentals/engage-and-retain/push-notifications/how-push-works

Change/update Firebase Notification Token Or Instance Id Forcefully Via Code?

Answer : Now i got my answer after facing many troubles for generating new or change token of firebase for push notification. 1) Delete old Firebase token let instance = FIRInstanceID.instanceID() _ = FIRInstanceID.delete(instance) FIRInstanceID.instanceID().delete { (err:Error?) in if err != nil{ print(err.debugDescription); } else { print("Token Deleted"); } } 2) Request new Firebase token if let token = FIRInstanceID.instanceID().token() { print("Token \(token) fetched"); } else { print("Unable to fetch token"); } FIRMessaging.messaging().connect { (error) in if (error != nil) { print("Error connecting to FCM. \(error.debugDescription)") } else { print("Connected to FCM.") } } UPDATE FOR SWIFT 4 & Firebase 4.8.2 (Follow simple two steps) 1) Delete old Token let instance = InstanceID.instanceID() instance.deleteID { (error) in print(error.debugD...

Android Push Notifications: Icon Not Displaying In Notification, White Square Shown Instead

Answer : Cause: For 5.0 Lollipop "Notification icons must be entirely white". If we solve the white icon problem by setting target SDK to 20, our app will not target Android Lollipop, which means that we cannot use Lollipop-specific features. Solution for target Sdk 21 If you want to support Lollipop Material Icons then make transparent icons for Lollipop and the above version. Please refer following: https://design.google.com/icons/ Please look at http://developer.android.com/design/style/iconography.html, and we'll see that the white style is how notifications are meant to be displayed in Android Lollipop. In Lollipop, Google also suggests that we use a color that will be displayed behind the white notification icon. Refer Link: https://developer.android.com/about/versions/android-5.0-changes.html Wherever we want to add Colors https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#setColor(int) Implementation of Noti...