Is it possible to create one Workight Push adapter for more than one application in the same Worklight Project ?
if it is faisable how do I configure my project because I think that the push notification is recognised by the application name in the Android environment. So the push Handle will work just for the first application but not for the others.
Any idea ?
Push notifications are not per application name. Why do you think this? Did you see it somewhere in the documentation?
See these topics:
Push notifications
Sending push notifications to the device
What you could do is either write very generic code and make sure your subscriptions are unique to the app so they won't overlap and send a notification to both apps, or use multiple Event Sources - one for each app?
The entity you declare in you adapter called EventSource. Any number of applications can subscribe to this event source. Now, the limitation is you'll be able to receive push notifications only in the app you've subscribed to push with. E.g. if you subscribed with app1 you'll be able to receive notifications with app1 only. In case you need to receive push notifications in app2 you'll have to subscribe separately. However there is nothing preventing you to use same EventSource (adapter) in both apps.
I resolved this issue by creating 2 Push Adapters, in each one I created an event Source.
After that,I created 2 applications in the same Worklight project, each one subscribes to a different Event Source but the both of them have the same pushSender configuration in the application-descriptor.xml file (same key and same senderId)
Notice that when created 2 event source in the same Push Adapter, the deployment of the adapter always fails, so that's why I created an separate adapter for each event source.
Related
I have developed a game with unity and I have used 'Firebase Cloud Messaging' for push notification.
I have one problem. when I clear the received notification in tray, it seems like the message related to it is also deleted. so 'MessageReceived' is not called when I open the app.
I experienced this problem on android. Haven't tested it on ios yet.
I use firebase admin sdk for sending messages.(written with node js)
is there a way to clear notification tray without deleting the message?
thanks for any help in advance
There is some extra setup required to route notifications when the app is not running on Android.
See the Firebase docs for more information
Quote from documentation:
When the app is not running at all and a user taps on a notification, the message is not, by default, routed through FCM's built in callbacks. In this case, message payloads are received through an Intent used to start the application.
Messages received while the app is in the background have the content of their notification field used to populate the system tray notification, but that notification content will not be communicated to FCM. That is, FirebaseMessage.Notification will be a null.
Basically you need to use the custom launch activity bundled with Firebase Messaging instead of the default UnityPlayerActivity. This activity is called MessagingUnityPlayerActivity can can be found inside libmessaging_unity_player_activity.jar. You'll need to create a AndroidManifest.xml file to instruct the app to use this custom activity instead of the default Unity one.
I have created one project in my Firebase Account. In this project, I have added two android apps.
Now, while sending push notification through Firebase console, I see the option of selecting my individual app as shown below
But, while sending notification through Postman, I don't know how can I send notification to only a particular app?
Should I create two individual project for both my apps, so that the server key is different?
But, I feel there should be a way to send notification without creating multiple projects for multiple apps.
Sending notifications to user segments is not available programatically i.e. not available when using the API.
A workaround you could use is Topics Messaging, creating a topic for the specific app and subscribe the corresponding users.
I am working on multiple apps having Firebase notification library. I will be using third party portal to send notification.
Suppose I want to send one promotional notification to all my apps and one device is having my 3 apps install. Now all 3 apps will show the same notification. How can I avoid this scenario.
Also, I have created one library to generate notification according to json received.
When I get notification, I am sending data to this library. This library is added in all my apps.
Can any of following help
1: Handling from backend- Creating one firebase project and adding multiple
apps.
2: Reading notification id in library which will generate notification and checking if any notification is already generated for the id.
As there is no way of finding out if one or multiple apps are install on one device, I have to send notifications to all apps.
With simple notifications, you can't: they are generated automatically by the system.
You'll have to send data messages and implement a logic to check whether any other of the 3 apps is installed and generate the notification only from 1 app (prioritize)
I am working on an android app where I want to be able to use the notification system within Firebase. I want to use the advanced features where I can add key/value pairs so that I can implement the notifications to do different things under certain conditions when clicked.
I obviously only want to test this on my test/development devices but can't see a way to do this.
You should choose single device choice on "send notification" screen.
After that you should get your FCM registration token. Yo can get token via this app.
https://play.google.com/store/apps/details?id=com.tune.mytunedevice
Write your token and send notification.
You could create a new product flavor for your app (e.g. "development") (Configure Build Variants) and create a seperate firebase project (with a seperate google-services.json file) (Add multiple google-services.json files).
Then you have different API keys for each project which don't effect each other.
You can get the FCM registration ID for those testing devices and send the message just for them, or create a topic/testing and register those devices to that topic then send the message just for this topic.
I have created an Push Notification application in IBM's Worklight in which it is sending notification for only one user's device(Android Device).How I can send Push notification to multiple user's devices?If any one created application then provide me some sample.
Worklight server must know user's identity in order to be able to send push notifications. In case you did not define any user authentication in your application, Worklight server will use an "anonymous" user identity - a persistent cookie created on first application launch. This is considered an unauthenticated access.
In case this is the model you want to use you need to declare an EventSource in your adapter which does not require authentication (do not specify securityTest for it) and then use WL.Server.notifyAll(eventSource, options) API.
This will send notification to users that are subscribed to a specified event source.
Source: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=462167&tstart=360
Push notification works on Android and iOS only.
You can see how to implement on iOS in the push notifications module.
You can find the module at https://www.ibm.com/developerworks/mobile/worklight/getting-started/index.html#advanced
What I did to accomplish this is to save in a backend database all the users subscribed to a specific event source then send notifications to each of them.
I checked the Worklight info center and WL.Server.notifyAll(eventSource, options) api is not listed!!