I am creating an web app and a user can start a game with multiple players (your friends). This game is played on 1 device. Is it possible that all invited players get a notification on their device where they can accept or decline the invitation ?
So in steps
Player 1 creates a game and invites player 2 and 3
Player 2 receives a notification on his mobile device and presses accept, he is added as player of that game
Player 3 doesn't have a device and enters his PIN to accept his participation.
The step that I want to have is step2.
I have read about OneSignal who can send push notifications to specific users, but I could not find if you can send a response back (accept or decline). Or is there an other way (without to have a native app).
your question is understood but at this moment a little too broad. But. I will try to answer in concept also :)
Now...you said you already know how to send target specific notification with OneSignal.
What you need to do from now one it cloud be like this:
Attach a link or click or action to that invite. Or when such invite
arrived open a particular view in the app/web/application that you are developing and revives the link.
Attach the session/game/user/object ID to that link and send the call
to you API (which is based on your server). If you have an API, if you don't you can have a very simple API build to handle only such requests with URL xxxx.com/path/to/api/call/var1/var2/var3/etc
From there you can catch the request and reply or adapt accordingly on your server side.
Maybe this Framework can help you to speed up the API dev in PHP. Lumen can do that trick.
You can follow this tutorial here for a fast API development with it.
Related
I have query about SMS API. I am aware about the SMS Gateway Integration Using SMS API
But my question is how to redirect the user to the respective marketplaces (Google Play and iOS app store) from the link sent via SMS gateway
Well I found some solution for redirecting users to there respective marketplaces.
Solution 1
Use third party tools which give you a single link to send via SMS and when user click on that link they will redirect to there market places.
below are some link which help you to get that Single link for your Mobile Application.
One Link
Branch Metrics
many more
Solution 2
Make a web page where you have to check user's device and Conditions to redirect user to there application store. Send Web Page Link in SMS.
Hope this will help Some one.
I am developing a web push notification system using Google Cloud Messaging (only web). I am using a GCM registration id to send the push notification in an Android device.
Can anybody tell me if there are any cases or scenarios that the GCM registration id will be changed for a device?
FYI, I would like to share my current knowledge:
The GCM registration id will be changed if the application is updated or re-installed.
If the device OS is updated.
My system design is as follows:
First, I register the registration id of the device in my database ?
(This is the only one time my client access my site and be able to get the registration ID and where I save it).
Then, I send a notification after a month or later (it depends, maybe even after 3 months).
Here are my questions:
If the device OS was updated in during that duration, does the device id change?
If the Chrome browser is updated or reinstalled, does the device registration id change?
If the registration id does change (because of one of the reasons above), how can I send a push notification to the desired device?
Appreciate the help. Thanks in advance.
Basically, I am now making a basic social network app on iOS platform, using PHP as the backend. I am be able to make the login, register functions in my social network app, however, I am now struggling how to add friend in my app.
As far as I know, I have to make a table for making_friends, just following this tutorial: http://www.9lessons.info/2014/03/facebook-style-friend-request-system.html
However, what I wonder is, if one user send a friend request to another user, then the "status" in the "making_friends" table maybe "0", to indicate that the friend request is sent and waiting for the reply. But how to let the other user know, that a user is sending a friend request to him, and then the other user may accept the friend request and updating the "status" to "1", which means the other user accepts the friend request.
In a word, I am not sure how to communicate from one client to another client, using server as a bridge. Does anyone have any good suggestions?
You can use push notification to send a request to a client or hit to server periodically and check the status but this is not a good way to handle it
For ios push notification check this Apple Push Notification Services
You can INSERT both users as one record in making_friends table and make a status for it.
making_friends table
--------------------
User1
User2
Status
Once a user inserted in this table you can make a flag on status and let the user know the request
I am trying to develop an android app that verifies a transaction initiated from a browser on a PC. I want the server application to push a notification of a new transaction to the app so the user can confirm to complete the transaction. The tricky bit is the transaction is specific to a particular person (I'm using this as an alternative to sending an SMS for example). Can anyone help on how to go about this? Is it possible to do this with C2DM or GCM?
Using Android GCM is advisable. The complete reference to GCM is available at
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
Step by step GCM development is given in there. It is really very helpful. Hope this is helpful to you.
The critical thing you need to keep in mind before making a decision is that when you are using GCM, you need to keep a track of the users by keeping their GCM_ID in your database. You can add a gcm_id column to your users table for this and whenever the user opens your app, the gcm_id should be updated in your database. The gcm_id of the user's phone can change, from the official docs:
Note that Google may periodically refresh the registration ID, so you should design your Android application with the understanding that the com.google.android.c2dm.intent.REGISTRATION intent may be called multiple times
GCM push notifications wont be able to reach your users mobile phone all the time,especially if his phone is not connected to internet or switched off.You are using this for transactions etc, so I assume that the notifications must not fail. You should keep a check in your web application to send an SMS or notify the user that this has failed. You should get a response from GCM to your server through which you can identify a failed case.
I was following these articles: Verifying Back-End Calls from Android Apps and Stopping Vampires using License Verification Library (from 24:57 to 25:34) to implement an In-App Purchase verification system for our Android apps.
I am a bit confused about how this works end-to-end and what we can assume about the generated token from calling GoogleAuthUtil.getToken() with the first email address found--when AccountManager returns more than one account. My questions are as follows:
Should we assume that any e-mail address used by the user to buy our
app will generate the same token (i.e., same user + app ==> same
token)?
If the answer to question 1 is no, is there a way to launch in-app
purchase for a particular account/email?
It looks like Google is picking the first e-mail address returned by
AccountManager for its in-app purchase dialog. Can we assume that
this won't be changed by the user after in-app purchase dialog is
launched? How do we find out if this changed after the in-app
purchase returns?
What should we store in our database to identify this user? Is email
address and/or token allowed? When does the token expire?
The java-client library looks very promising and powerful at first
read. But, a number of things remains confusing. Is there an article
that describes the end-to-end scenario--from an app initiating a
call to a back-end server through launching the in-app purchase
dialog, getting the result and closing with commits on the server?
What articles are the most useful for accomplishing this on Android?
The main issue we are trying to solve is to to get the full picture.
We've gotten the idea that we can avoid requiring userid/password by using the java client features and using tokens. We have registers our project (both the web app and android app on the same project) per the instructions for Google API Console. We have the php java-client for Google Play Service on our back-end server. We got our Android app to generate a token using the first email address and then call the in-app purchase dialog and handle the user response at the end of the dialog. We've got the parts. Now, we need to glue everything together. We are at the point of integrating with the back-end server. E.g., What is Redirect URi supposed to point to in our server? We've got a php url that we do http post messages to for our server app. We've included the code example for Google API client example--with client-id, secret, simple api key, etc. filled in--as an include to our php. But, what should we put in the redirect uri (we are missing a usage instruction for the example code)?
Also, we want to avoid having the e-mail used for the in-app purchase be different from what we log on our server database as the address the user used to buy our app; if the address is the correct thing to track, we want it to be the same as what was used for the purchase. This could be frustrating for our user if we make this mistake and prevent them from the features they paid for. We don't want to make this mistake and need some clarification on how Google Play Service works. If we initiated the server part of the workflow to get app Nonce / Payload / Credentials for the first e-mail address on the Android device, we would want that address to be used throughout the workflow. If the user changed this along the line, we want to be aware of this and gracefully recover. So far the articles have been helpful but incomplete. Any insight/suggestion is appreciated.