Worklight Push Notification for multiple user - android

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!!

Related

send notification to ios and android using FCM Rest Api (New Versio)

I have a net core Back-End (3.1).
I created a page in which admin should enter title and description and pick a user to send a notification.
I want to send notification payload to Apple devices and not to an android device similar to a custom notification.
there is a platform-specific notification in Firebase Cloud Messaging documentation .
However, I was not able to implement it .
If you wanna only send the notification to Apple devices only. Then APNS Push notification push gateway will be suitable for you. See here
Certainly, FCM can also deal with this issue. You need to add the ApnsConfig to your request and send it to the FCM server.
If you cannot implement it, you need to mention more detail about your issue (trace log, exception info, etc.)

Using push notifications to trigger code within Android app?

Using a serverless architecture built on AWS, I'm looking for the best way to have users receive near-instant notifications of new "chats" within my Android app. I don't necessarily want to see a push notification appear in the phone's notification tray - I just want the app to listen for new messages, and update the view accordingly.
Here's my thinking: every time a user sends a chat, I'd basically trigger a Lambda function which would call SNS or IoT to publish the notification to any subscribed users of this chat.
But since SNS / IoT both work by sending "push notifications" to the phone, does that mean the message would have to appear within the phone's notification tray? I'm just looking for a way for my app to silently receive near-instant notifications from AWS and execute code to update its view.
Some other notes:
1) I don't want to build this using a server / EC2 with websocket listeners - I'd rather go serverless.
2) I've looked in Google's Firebase real-time DB which looks very capable, but as the rest of my architecture is on AWS, I'd like to stay there if possible
If you are making app for Android only, you can make use of the data message in FCM from Firebase. You can handle the message in onMessageReceived no matter your apps is on Foreground or Background.
Apart from that, firebase provide integration with most server side language. You should be able to send the message in your lambda function.
my suggestion is using FireBase...
and make your Json tag with "data" than "Notification"

Use FCM with another database

I am developping a mobile application that must implement push notifications. Documents are stored on a SQL database, and people should be able to edit these docs after downloading them offline, then the modifications should be saved in the SQL Database once the phone is online again. People should be able to receive notifications when the app is closed.
I heard that I need push notifications, and for android there is Firebase Cloud Messaging (FCM). But is it possible to use FCM with my SQL database ?
All tutorials in the docs only speak about connecting the app with Firebase
For your project you need a server with your API, SQL Database... and a push notification server that ask FCM services to notify your registered devices.
FCM works like that :
You add the FCM plugin in your Android/iOS app, then when you launch the application it will ask FCM for a unique token associated for your device and this app. You will store that unique token in your push notification server, I advise you to associate it with a user identifier or one thing that you will use to identify the device to notify.
When your first server (with the APIs and the Database) did some action and you want to notify a device :
The server will ask your push notification server to notify a list of devices that you will probably determine with the user identifier like I said earlier, then the push notification server will find the associated tokens and send all of the pre stored tokens to FCM with the notification content you want to send, you can also send parameters that will be used to do special actions in your mobile app.
Finally FCM will notify your devices :)
Hope it helps.

Sending push notifications to a list of friends in an Android Native App

I am creating a native Android application that sends push notifications to a specific list of friends. How to send push notifications just to this specific list in Android ?
Actually Push Notification mainly sends from server, from application side you must need to create one Browser Key on Google Api Console, after creating your app there and need to activate GCM from there.
Then, you need to give GCM Registration Id to your server and then whatever push you want to fires, server triggered one query with it and will send push to all your friends list.
Take a look the Urbanairship, it provides send the notification by registered tag/id, and also provide broadcast notification.

How to send a push notification from one Worklight-based Hybrid app to another Worklight-based Hybrid app

I run Push Notification Sample code on Worklight server and its working.
Now i want to send notification from one device to another device so what are the required changes in the adapter?
The adapter XML:
<displayName>PushAdapter</displayName>
<description>PushAdapter</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>https://android.apis.google.com</domain>
<port>8080</port>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2"/>
</connectivity>
Should i change domain and port and i have to upload the app first on google play so that i can able to recive or send notifications. And should i create a key for android device on GCM
Push notifications in Worklight (and I believe at large as well) are not sent from one device to another per-se; consider it this way:
You have two applications:
A managing app
A receiving app
User A is running the managing app - this application is able to send a request to the server, which tells it to send a notification to some other user(s).
User B is running the receiving app - this application is able to receive notifications.
All of this is not related at all to the Google Play store.
Yes, both apps will require a GCM senderId and Key values in order to have any Push Notification capabilities.
As for implementing all of this... there is no sample to do this, but you already have part of the solution (the sample app is able to receive notifications). What you need to do now is have the managing application be able to retrieve a list of / specific username(s), and create a procedure that will invoke a function to send the notification based on the username(s) you have retrieved.

Categories

Resources