tagged push notification to android (google cloud messaging) using azure - google-cloud-messaging

I am using Azure's Notification Hubs REST APIs to create a Native registration for Google Cloud Messaging with a tag. (http://msdn.microsoft.com/en-us/library/dn223264.aspx)
The API call runs successfully and returns a RegistrationId as well as my tags in the XML response:
<GcmRegistrationDescription
<RegistrationId>222222222222222222222-1111111111111111111-2</RegistrationId>
<Tags>toto ,titi</Tags>
</GcmRegistrationDescription>
However with the debug console, I fail to push a message to that tag with the error below:
No registrations with the tag "toto" were found for the selected platform.
The Read Registration method of the REST api does not return the tags either. It returns an Etag element.
<GcmRegistrationDescription>
<ETag>4</ETag>
<RegistrationId>222222222222222222222-1111111111111111111-2</RegistrationId>
</GcmRegistrationDescription>
The same works great for the iPhone when creating a Native registration for Apple Push Notification Service.
Any ideas on what I missed would be greatly appreciated!

Related

WhatsApp messaging webhook does not work in production mode

I am trying to create a connection between our WhatsApp Business account and our website where we gather all messages sent to our business on different channels (through our own app, text, WhatsApp, ...).
I've followed this tutorial (https://developers.facebook.com/docs/whatsapp/cloud-api/get-started) and have everything set up: our WhatsApp Business is working correctly, I've added a Meta App and I've set up the webhooks with a connection to my node.js backend.
When I click Test next to the "Messaging" webhook, I receive the message on my node.js backend and website. So I know this side is working as it should.
I've then used the Graph API to subscribe my Meta app to the messages with the business id of the WhatsApp with the correct permissions. When checking the subscribed apps with the {business_id}/subscribed_apps endpoint, I can see my Meta app. So I believe everything is set up correctly.
My Meta app is also set to "production".
However, when I try to send a message with my personal WhatsApp to my business WhatsApp, I receive nothing on the webhook.
I checked the logs on my server and nothing is being received, so I know it's not an issue in my node.js backend.
Is there something else I need to do to make this work? Does the Meta app need to be verified to use the webhook in production? If so, how can I do this? The guide for verification says I need a platform and login insctructions, but the Meta app is really only a webhook without an interface.
Thanks in advance.

Is there a REST api to create a channel in Agora Web sdk?

I'm trying to integrate our web app with voice/video call feature by using Agora. I have read the documentation on their side, but I have not found any rest api for web sdk to create channel. Basically, when a user joins a channel, we have to pass in the app id, token, and channel name. I know that we can create channel in agora dashboard, but I'm looking for a dynamic way, where we can trigger a REST api to do it. Any help would be greatly appreciated. Thank you.
You can deploy your own token server, that will give you the token based on a channel name and uid.
Here's a pre-built server that you can deploy to Heroku in 2 clicks.
I have been able to build a node js to generate agora io token. It is hosted in heroku. The source code can be found here:
https://github.com/Hoang-Minh/partie-agora-token-generator
Here are the endpoint that you can call to generate a token:
api/agora/rtcToken/:tokenType where
tokenType can be either uid or account, depends on what you need.
The default expiration time that I have is 24 hours.

How can I make a react native application with push notifications and an API

I am building a new application in React Native and I built an API for the back-end.
I want to build in a push notification in the app when there is a new entry delivered by the API. I saw a framework that background fetches an API route and then shows a push notification but this only applies ones every 15 minutes. Other push notifications tutorials I see only work with a firebase database and I need it to work with my API.
Is somebody known with combining rest api's with push notifications in react native, that can help me?
Greetings,
Laurens
step 1:- first you need to add react-native-firebase, messaging in your react-native project for receiving push notification.
link to add react-native-firebase
step 2 :- check your application setup using firebase console's
Cloud Messaging service.
https://console.firebase.google.com/project/fir-demo-f375c/notification
if your application setup is perfect you will get push notification in device from firebase console's Cloud Messaging service.
step 3:- need to add server side code to fire push notification from server,
when your api hites to using server language like PHP.
for more detail in step 3 follow
https://firebase.google.com/docs/cloud-messaging/server#implementing-http-connection-server-protocol

Firebase Cloud Messaging with serverside API push for obj-c

currently I working to implement Firebase Push Notification in my apps.
I found this:
[background] Using Firebase Console my apps can get the notification from system tray with remote notification
[foreground] Using Firebase Console my apps can get the notification from log, but i can make it into notification center with local notification
[foreground] Using Our Dashboard which managed by PHP serverside, I can get notification from log, but i can make it into notification center with local notification
The problem is, how can i get the notification (log is fine) if my apps in background with Our Dashboard which managed by PHP serverside?
I found that there is different between json I got from Firebase Console and our managed serverside dashboard, is that a problem that my apps cant handle? and how i can handle it? can I get the sample of the code to solve this problem?
This is the different between json i got from firebase console and our managed serverside dashboard
firebase console
our managed serverside dashboard
What you want to do is possible by using the normal FCM api.
Please review the differences between Display-Message and Data-Message here:
https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages
and see all the parameters in the reference page:
https://firebase.google.com/docs/cloud-messaging/http-server-ref

How to configure Android Push Notifications (GCM) in Appcelerator Titanium Dashboard?

I've tried to following the instructions
Configuring push services for Android devices
However, the steps mention 'Click Push Notifications on the left-side navigation' but they don't exist...
Once you've created a Google API project with GCM enabled, you need to update your application's settings page in Dashboard with the API key and sender ID you generated.
To configure Arrow for push notifications using Dashboard:
Open Dashboard and select your application from the Apps drop-down menu.
Click Push Notifications on the left-side navigation <-- MISSING.
Select the Android Push tab.
Enter the server key in the GCM API Key field and the GCM sender ID in the GCM Sender ID field.
Here's a screenshot to show what's listed...
If I look under Arrow (where I suspect it might be expecting to be listed) that's empty (I'm not using Arrow - I thought it was an alternative UI using declarative XML)...
I've checked the subscription that I'm on (Indie) and it shows that I should have the ability to send up to 1 million push notifications for free..
Does anyone know how I can associate the Appcelerator Titanium project to the GCM server key??
Also, when I looked in Googles developer console, my application (which is live on their app store) wasn't listed, so I've created a new application called 'Gcm'. The Appcelerator Titanium seemed to confirm that I needed to 'create' the application, I was just too worried to call it the same name as the live application. How does the 'Google Developer Console' Application relate to the 'Google Play' application?! - if at all?
UPDATE
I've just discovered in TiApp.xml that I can enable some 'Cloud' settings and this has unlocked the 'Push' menu - so I think all is good now, could someone confirm that this is the right thing to do and answer my related question about Google play applications v google developer console applications?
Update 2
I started to get this error
[ERROR] : GooglePlayServicesUtil: The Google Play services resources
were not found. Check your project configuration to ensure that the
resources are included.
[INFO] : CloudPush.retrieveDeviceToken error: INVALID_SENDER
I'm simply calling this to try and register for Android push notifications ...
CloudPush.retrieveDeviceToken({
success : function(e) {
console.info("CloudPush.retrieveDeviceToken success");
},
error : function(e) {
console.info("CloudPush.retrieveDeviceToken error:"+e.error);
}
});
I have tried with and without the ti.cloud module (I think it got added when I clicked the 'Enable Services' button which meant that I could see the 'Push Notifications' tab, but it seems to still be listed whether the ti.cloud module is elected or not)..
Before..
Q - How to stop the Google Play error and retrieve the device token (oddly I was getting the token before enable services.
Q - Is ti.cloud used to receive the push notification, or is ti.cloudpush sufficient for this?
Thanks for the detailed question :) Let me go into some of the things you mention and clarify what I can.
If I look under Arrow (where I suspect it might be expecting to be listed) that's empty
As you later found out you have to enable platform services for your app which will create an ArrowDB app with the same name as your app. This app will have the Push Notifications in the sidebar to configure. I've updated the guide's wordings to make clear we mean the ArrowDB app, not the Titanium app.
(I'm not using Arrow - I thought it was an alternative UI using declarative XML)...
Don't confuse Arrow with Alloy - which is the MVC framework for Titanium which indeed uses XML.
How does the 'Google Developer Console' Application relate to the 'Google Play' application?! - if at all?
It doesn't. You can even have multiple apps share the same GCM sender.
[ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found.
What did you use to test? A Genymotion emulator without Google Apps installed perhaps? You'll need that.
Is ti.cloud used to receive the push notification, or is ti.cloudpush sufficient for this?
ti.cloud is the module to communicate with ArrowDB, subscribe to channels etcetera. On Android you need ti.cloudpush (or as #Shawn mentioned another module) to retrieve the device token where on iOS you can use a Ti. API for that. Follow this guide for all steps.
You can ignore the Google Play Service error, but it seems your GCM Sender ID and/or API Key is wrong. Read through the tutorial and make sure you put down the right ones.
If you are using Appcelerator Cloud Service to send push notifications, you need ti.cloud to register the devices.
To get the device token and to receive push notifications, you use ti.cloudpush. There are other modules that you can use instead of ti.cloudpush.