Assigning webhooks to Firebase Messaging "subscribe to topic" event - firebase-cloud-messaging

In my current project I am using the Kreait Firebase PHP SDK to send out push notifications to Android & iOS devices that have subscribed to notifications on named topics. No issues thus far. However, rather than have fixed topic names I would now like to generate topic names based on the current "condition" of the connecting device. The condition could, for example, be a geographic location.
This is not too difficult either and I have modified my app to handle this. However, in order to put the ability to have such autogenerated topics to use I need to know the topic names on my server so I can send out targeted messages via Kreait. I find Google's Firebase documentation a bit dense at times and have not been able to establish whether it is possible to assign webhooks that get called by Firebase whenever a SubscribeToTopic, UnsubscribeFromTopic event occurs.
A simple question - does FCM even offer anything like this capability? If so, any pointers to the relevant documentation would be much appreciated.

There is no public API to get a list of topic names from Firebase, nor is there a way to hook into the subscription mechanism.
Your best bet is to simply make two calls when a user subscribes to a topic: one to Firebase, and one to your own backend API that keeps a list of active topics/conditions.

Related

API Whatsapp to send messages from an external application

I want to implement Whatsapp
to send information from an external application. The idea is to use this
external application to send information throughout Whatsapp.
If you can help me about the terms and
conditions and if this query is possible to develop.
There is a way through which you can send WhatsApp message from your self created application. Use this link Chat API.
But it only provides 3 days trail period and after that you have to purchase it.
The process in that is, you have to register with your google account, then scan the QR code provided(which changes after every 45 seconds). and you are set to go, they will provide you the API for : PHP, Node.JS, Jquery, CURL.
One thing more you always have to keep your phone connected with the internet everytime.
Also I found a drawback in that, i.e. they also provide API to read messages, but it is too slow, as in my condition I can see my messages of yesterday but not of today.

Why can't I delete native events with Cronofy.com?

I am using Cronofy to integrate my application (only locally tested yet) with multiple calendar platforms.
I am having trouble getting it to update or delete events which are created natively (google or outlook) and I cannot understand why. The documentation (https://www.cronofy.com/developers/api/) is not sufficing to understand it and there's not much more out there besides that.
When I send a request for deletion of a native event I do get a 202 HTTP response back but the event remains in my google/outlook calendar and if I do the same for my own event it deletes there smoothly with the same 202.
How can I make it work? I've read about auth flow and that 202 means it is processing but this processingtime seems to be taking too long for it to be that (~2days)
As standard, we sandbox calendar access and don't allow developers to edit existing events in end-users calendars.
There is a process you can go through to request extended permissions on one or more of a user's calendars if you need this functionality. Let me know via the support#cronofy.com if you would like access to this.
We differentiate between 'managed' and 'unmanaged' events in our API to help streamline the kinds of operations different use cases require.
Managed events are events that are created by your application. When they are created we require an event_id which is your id for the event in your application. You have complete control over events with an event_id. In order to delete a managed event you would pass the event_id as the identifying parameter https://www.cronofy.com/developers/api/#delete-event
Unmanaged events are events created by the user in their calendar. These have an event_uid which is used to identify the event. If you have sufficient permission to delete unmanaged events then you would pass this event_uid as the identifying parameter.
The reason we're returning a 202 is that our API is asynchronous. Every API request is a journal operation which is executed by a worker. We don't inline calls to downstream APIs. Instead we protect your application performance from having to deal with whether a calendar server is available and responsive to meet your request.
I hope this helps explain what you're seeing. Any questions, let me know either hear or at support#cronofy.com.
Adam

Implementing Facebook's Like feature using Google Cloud Messaging

I have a use case to implement a 'like' feature for messages using GCM. One approach that comes to mind is to make each post a 'topic' and then send all likes on a post as a separate GCM message on that topic.
However, in order to achieve this, the client has to register for each topic corresponding to the post that it has loaded on the UI in real time. This brings me to the following questions:
This is approach right?
How long will it take for a client's subscription to a topic to reflect at GCM's end? Same for unsubscription?
Can I get a list of all subscribers to a given topic?

Apple iTunes Connect Analytics: attribution provider and campaign id value passing to the app delegate

The new iTunes connect has analytics features now. You can specify the provider (pid) id and campaign id (cid) in the url. e.g.
https://itunes.apple.com/fr/app/candy-crush-saga/id553834731?mt=8&pid=1234&cid=My_Campaign
Can you pass those values into the app for various purposes?
I could not find anything that points to that, even after checking:
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
ref:
http://www.applift.com/blog/new-era-attribution-analytics.html
Unfortunately these params are not passed into the app. They are only used for iTunes Connect stats.
Here are the two common workarounds:
Using a fingerprint to implement deferred deep link and passing the params through that link (Tapstream can do this).
Using a provider like Tune/MobileAppTracking to match the link using the ID for advertising (IDFA).
I wrote a blog post to explain the details: https://attributionapp.com/blog/lets-solve-ios-attribution-methods/
I will edit this response in the future if Apple changes their API. If you let Apple know what you want to build and why passing in the params is a better policy they might change their minds faster: https://developer.apple.com/contact/
If you'd like to build your own fingerprinting mechanism to handle all of this deep linking like we have at branch.io, I can give you some instructions how! One side note as I read it in the accepted answer comments is that the INSTALL_REFERRER in Google Play is often very slow (> 1s delay) to launch after install, so if you're depending your user experience on this, your users in are in for a bumpy ride.
Here's how we built fingerprinting on iOS:
Configure a server endpoint (something like yoursite.com/redirect) to accomplish two things:
Serve up some client side JS to open your app if installed or fall back to the App Store if not. I listed out this code in this answer
Capture a set of of parameters about the clicking user by reading their user agent, etc. Here's a simple subset that will work well:
OS
OS version
IP address
Device model
When the user opens the app, send back that set of parameters, as read from the app to a new endpoint (something like yoursite.com/completematch).
If there's a match, you can pass back the parameters.
If you want to get savvy, you can drop a cookie on yoursite.com and save the match to the IDFA received from the app. Ideally, you'd only do this if you redirect into the app immediately so you're 100% sure of the match. Then if that same user ever clicks on the link again and installs the app, you don't have to use fingerprinting as you can just use the cookie-IDFA pair. We've got hundreds of millions of these at Branch so fingerprinting is more of a fallback mechanism at this point.

How to get notification subscriptions in Worklight

I want to trigger VERY basic push notifications, but, don't see any way to iterate through all the subscribed users, without rolling my own tool to read the db notification_user table. Surely, with such an extensive (and expensive) product such as Worklight there is an API to do this?
The only way I see is within my adapter to call another HTTP adapter (go get the user subscriptions). And, I've tried using the HTTP interface to retrieve the subscribed users via:
http://<server:port>/<context>/console/api/push/get?adapterName=PushAdapter&eventSource=EventSource
and many variations, but, nothing seems to work through browser testing (the doc indicates all are GET requests). There are NO examples of how the "Push, Event Sources" (?) format for the api is (should the "API Context" value be "Push", or "EventSources", what?). The chart given in the Worklight 6.0 Information Center is pretty bare minimum (how difficult would it have been to include an example of each?)
Basically, I want to iterate through a specific adapter/event source in a WL adapter, grab the "options" that were passed in when the user subscribed to perform some business logic on whether to send out a notification. Would think this would be a very common pattern, but, don't see any examples of this type of model.
Anyone have suggestions for similar processing with WL 6?
Thanks.
You're not wrong. Worklight has 3 methods to send out notifications to subscribed users/devices
See
WL.Server.notifyAllDevices
WL.Server.notifyDevice
WL.Server.notifyDeviceSubscription