IBM Bluemix push notification through PHP code - php

I am new with IBM Bluemix and I want to add PHP code for sending push notifications on both iOS and Android devices.
My app is built with the Xamarin platform for both type of mobile devices.
The backend is created in PHP with the Codeigneter framework.
I see in the Dashboard there is direct user interface for sending a push in Bluemix, but I want to send a Push on run-time for example: some user sending a friend request and the other user automatically receiving a push notification.

There is not a PHP SDK library, but you could accomplish your behavior by checking out the Push Notifications Swagger documentation:
https://mobile.ng.bluemix.net/imfpushrestapidocs/
First you would register your mobile app so it receives push notifications (using the Android or iOS Client SDKs available here). Then you could have your backend send the push notification to a specific device on the event that a friend request is sent by using the REST API (as outlined in the Swagger docs).

Related

Send FCM message to specific Google user without need to install an app?

I'm doing a tiny personal project involving an Arduino and a PHP backend. I want to send a push notification from the PHP backend to my Android phone using Firebase Cloud Messaging. This question is specifically about FCM - I don't want to use any other services like Blynk, etc. I also do not want to send the notification directly from the Arduino, but rather from the PHP backend.
Can I send a FCM notification to my phone without having to create an app to receive it? I'm logged in with a Google/Gmail account on the phone, and I have no need to target any other users than myself.
Can I send a FCM notification to my phone without having to create an app to receive it?
No, this is not possible. It would open users up to some pretty hefty abuse.
In order to receive your notifications, the user must have your app installed.
Mind you, this can be a pretty minimal app, since the default implementation of FCM already displays notifications to the user if the app is not active. So really all you have to do is create an empty app that includes the Firebase Cloud Messaging SDK.

Firebase Cloud Messaging API

We are using Firebase Cloud Messaging for iOS and Android. Just wondering if its possible to create a web application that has a form whereby we can send push notifications to both platforms at once - assume we know the topics to send to. (maybe using POST/cURL requests)
yes you can send the push notification in some of the web browsers using firebase integrations (web push notifications)
please go through the following link
https://developers.google.com/web/fundamentals/push-notifications/
https://www.w3.org/TR/push-api/
https://firebase.google.com/docs/cloud-messaging/js/client

Notification on Browser with Firebase

I use FCM for mobile app. Now my project requires to deploy it into web-base application. But FCM just support Chrome-app only. Is there any solution for pushing notification from FCM to browser?
maybe you're looking for Adding Push Notifications to a Web App, it's FCM too.
works with the Push API of HTML5 and uses ServiceWorkers
https://developers.google.com/web/fundamentals/getting-started/codelabs/push-notifications/

How to send push notification by using php to android

I'm trying to send push notification to my app from PHP server.
but I don't understand certain thing like what I need to make PHP server.
I have my app. I configured every thing.
I have created my app in phonegap.
I have API KEY, Project NO., and Registration Key.
I have follow this articles:
Google Cloud Messaging GCM for Android and Push Notifications
Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL
Push notifications with PhoneGap and Android
but still not able to create php page to send notifications.
I can send notification using pushbots.
but I want to create my own PHP page to send Push notification.
Please help me with this.
I will really appreciate your help.
Thanks in advance
For a good example of PHP code that send Android push notification look at this gist.
In order to have always the updated version of registration tokens, you should write another php page that receive tokens from devices and write them in a db. Then you can get these tokens before sending push notifications.

How to use websockets and push notifications at same time

I currently run an app in php zend framework that contains a real chat using node.js and socket.io, the chat is working really good, but i need to create a service to send push notifications using the pushwoosh technology, is there any way to send the push messages in the node.js server? or i have mandatorily to create a service in zend framework, considerating that chat is running in an mobile app too, and the messages should arrive even when the app is closed.
thanks for your help.
Sending push notifications on mobile devices cannot be done stand-alone and you must take in consideration that you have to rely on third-party services.
The concept is that you don't directly send push notification to your application, but you send the request to a third party service asking to send the push notification to your registered application.
For example, these are the steps you will go through to send a push notification to an IOS application:
An app enables push notifications. The user has to confirm that he wishes to receive these notifications.
The app receives a “device token”. You can think of the device token as the address that push notifications will be sent to.
The app sends the device token to your server.
When something of interest to your app happens, the server sends a push notification to the Apple Push Notification Service, or APNS for short.
APNS sends the push notification to the user’s device.
(reference: http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1)
So it's not as easy as you wish to. You won't directly send the push notification, but you will ask to apple in case of IOS or to Google's server in case of android to send it.
In most case, you will have to register as developer on their dev centers and get all the tokens and certification they ask.

Categories