I need to use Baidu Push notification in my app. But it is very difficult to find the documentaion on it to know about the difference from GCM.
Is there any document or site available to know the exact difference between GCM and Baidu Pushnotification ?
Also which is better to use in terms of performance ?
In terms of functionality there is no difference between GCM and Baidu Push notifications.
Baidu can be considered as an alternative for your GCM in china, as most of the Google services are blocked in China. Since, GCM is a part of Google-play-services package, it is also blocked in China.
Documentation: For this you would need to use google translate on pages specified below (ie. once the page is loaded, right click and select translate to english) :
Step 1: Create a new Developer account on Baidu platform. (If you do not possess a Mainland China Phone number, it is not possible to create a Baidu developer account)
Step 2: Download the Android SDK for Baidu push services from the below address:
http://push.baidu.com/sdk/push_client_sdk_for_android
Step 3: Integrate the above downloaded SDK into your app like you would do for any SDK that has *.so (Shared Object file libraries) files. That is you need to put them in your jniLibs/
Step 4: Then like in GCM console you create a new application with its application Id/ Package Name, in baidu as well you need to do the same. That is goto the below URL (Make sure you are logged in):
http://push.baidu.com/console/app
On this console page Create a new application (Use Google translate plugin on Chrome).
Step 5: Once a new application is created, your application will be assigned a API Key and a Secret Key. Inorder to receive Push notifications, you need to used the API Key as specified in the below page:
http://push.baidu.com/doc/android/api
All the development steps are specified in the above link. Just translate the page to follow the same.
Step 6: In GCM you can either send a push notification using the GCM console or you can use your own server to send a GCM notification to the device. Its the same on Baidu as well. Details are in the above link.
Performance:
From my personal experience, i feel GCM is really good. I always get the Notification immediately. However, in case of Baidu, it does take sometime for the notification to arrive(most of the times).
Also there is a Demo example which comes along with the SDK. You can keep that as a reference while developing the app.
Related
I host a PWA website and I am trying to integrate push notifications to my users who may have the website open in a browser tab even if their phones are inactive. You notoriously can't send Push notifications to iPhones without using Apple Push Notifications service (APNs).
Seeing as the point of firebase cloud messaging (FCM) is to outsource the message handlers, I kinda assumed it would support sending push notifications to iPhones somehow via APNs, but the information here suggests you still can't do this from the web.
https://firebase.google.com/docs/cloud-messaging/js/client
Safari and iPhones don't support Push API.
According to this answer: https://stackoverflow.com/a/64576541/2116253
Option #2 may be possible if you know the device ID token, which is apparently very hard to get and perhaps not possible anymore because Apple are trying to make it harder to obtain due to security concerns.
I think the actual sending via APNs from server side is quite easy, the problem comes with the initial setup/registration and actually granting permissions that allow notifications to arrive.
So, in short, I don't mind registering my website with Apple, agreeing to terms and obtaining keys for the purpose of interfacing with APNs, but I don't want to make and distribute a whole native iOS app just to send notifications to devices about my website.
Does anybody know the correct way to achieve this in 2022 ?
I had a project from two application(flutter application) and three flutter-web on the same firebase i want to send notification from the web to the application.
i searched alot for this and i cant find any answer or solution for this case.
I had a project from two application(flutter application) and three flutter-web on the same firebase i want to send notification from the web to the application.
i searched alot for this and i cant find any answer or solution for this case.
I hope you understand that we can't give you the finish solution here. I would recommend to you to go trough this docs.
What we can do is to explain it a little bit. For your solution I would recommend to use FCM. And how they work is that:
you use the Firebase SDK to receive a token from the client device.
you store that token on one of the Firebase databases
when sending a push notification to a device you would need to do it from the Firebase Cloud Functions and use that token to send the message to it. When you do that the device from witch the token is will get the message.
It doesn't matter what platform the device is (web, ios or android). All of them can receive Push Messages (in Web most of them but nor 100% all).
From your use case I would not recommend to use topics. You want to send messages from device to device and therefore the tokens are the best solution for it.
I integrated Firebase Cloud Messaging with Unity successfully and I can receive usual messages when I send them from Firebase Console, but I need some extra things.
1 - How can I send my notification as a URL? I mean I want that when user touches the notification it opens the URL that I put in the value in FireBase Console.
2 - How I can send and show a picture and a custom icon in the notification?
Unfortunately, I can't find anything on the internet and official documents confused me.
Is there any way to gain these request only with FireBase SDK?
Thank you.
You have to handle all the messages from FCM manually to get all those features you are looking for. I mean you got the general implementation all the stuff, but you need the unique one. All the notification display settings and notification click handlers have to be implemented on the Android native side.
Probably you will find some interesting FCM asset in the Asset Store with nice notifications customization, not sure. But I would recommend you to surf the Asset Store, maybe there will be some useful packages.
I have developed an app for an open source home security solution (ZoneMinder). The app I developed is called zmNinja (open source again) - and it works rather well. I am now implementing a mechanism to push notifications (motion detection alarms) to people who will use the app.
After going through the APNS and GCM documents, it looks like the "server" which sends the push to devices must integrate with SSL certificates and API keys generated from Apple and/or iOS. And this, specifically for apple requires a developer account.
Therein lies the predicament. Users of 'zoneminder' install their own servers. There is no central server. I've developed a event server that works with 'zoneminder' on web sockets that can be installed along with zoneminder and it sends notification when there are new alarms. This works very well on Android because Android allows the web socket to be open in background but iOS kills it (I can't treat the socket as VoIP/Location/content-news as its none of the above). Hence I am thinking of how to support APNS in the server. In other words, even if I can't do GCM for Android, there is still a way to receive alarms. No such joy for iOS users.
The problem is that like I described above, I won't be hosting the server. The users of the app will own their own server.
Given this, is there any way to support push notifications in IOS without requiring everyone who has their own servers to have apple developer accounts? I assume I can't give my certificates to them either as that would compromise my account.
Thanks
Can you interrogate the Apple (APNS), Google (GCM) or Windows Phone push notification servers after the fact to find if a notification was delivered?
I know that when a server initially sends the push notification there is a response to say whether the message was processed (but this doesn't mean delivered) or rejected by the notification server. But is there any way to subsequently find out via Android, iOS or Windows Phone 8 if the message was delivered?
Ideally I'd like to achieve this just by interrogating the vendor's push notification server, worst case I'm assuming I'd have to put something in my app to register that a given notification arrived and somehow transmit this success status back to my server.
APNS, GCM and MPNs don't offer this functionality.
You'll have to support it yourself, by sending an acknowledgment from the app to your server whenever a notification reaches your app.
For GCM you can view statistics of deliveries, but nothing for individual deliveries :
Viewing Statistics
To view statistics and any error messages for your GCM applications:
Go to the Developer Console.
Login with your developer account.
You will see a page that has a list of all of your apps.
Click on the "statistics" link next to the app for which you want to view GCM
stats.
Now you are on the statistics page.
Go to the drop-down menu and select the GCM metric you want to view.
Note: Stats on the Google API Console are not enabled for GCM. You
must use the Developer Console.