Sync contact android and ios? - android

i am trying to develop an application to sync contact's from device to server
i am aware of GOOGLE CLOUD MESSAGING, but what i exactly needed is to have my own server for contact's and if i manually added a contact in my server it should be update on device without any interaction by user on device.
The same process in ios and other platformed device's also.
similar to this : sync Contacts between iPhone(also Android) and server
The core of my question is : how to update any changes made in server on device side automatically thank you

Try looking into the SyncAdapter and trigger the updates via a push notification using GCM. The general structure would be:
A change is made in the contacts on the server side
The server sends push notifications to the devices that need to update the information
The SyncAdapter requests the updated data from your server

For IOS you can use APNS just like GCM for Android.

Related

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.

Receive notifications on android upon database change

I have an android app which is capable to interact with a (for now local, but in future online) RESTful database (using PHP and Slim framework).
A registered user can create/upload new text, view all its texts, delete and modify them.
The user can log through different devices (Android smartphones for now, but in future with Desktop computers as well) and perform said operations.
I need that EVERY device (on which the user is logged in) is notified upon each change in the database.
What is the best approach to implement such notification capability either on the PHP/MySQL server and in my android app?
I have heard about Google's Firebase Cloud Messaging but i'm not sure neither if it is the easiest and fastest way to do it, nor if it is compatible with my already working environment.
Please guide me in the right direction as i don't have a clue on what is best for my case.
You have to registered mobile device or desktop to fcm/gcm server or apns in case of iOS . When database is updated on server then it will get a trigger so on after save will send notification push with your payload.

In Android, sending notifications to android phones via code in Firebase

I am developing an application that saves some data in the Firebase Database. As soon as the data is saved, I want it to be given as a notification to all the users connected to the application through code.
I couldn't understand the procedure to do so. Can anyone explain me how one can send push notifications via code in the chain as Android phone -> Firebase Database -> Notification to Android Phone with the data.
it isn't Possible to solve your Problem with Firebase only. You have to create a MySQL Server and work with PHP. Maybe this Video from Filip Vujovic could help you.
https://www.youtube.com/watch?v=LiKCEa5_Cs8
You can use GCM,it's simple.The GCM service handles all aspects of queueing of messages and delivery to client applications running on target devices, and it is completely free.

Send Firebase Notifications from android device

I just switched my app over to firebase 2.0 from parse. Basically I have an android app (main app) built for the general public to use. Then I also built a second app (manager app) that only I and a few others have access to which is used to update the content of the main app. Now I am adding in notifications which work fine when I send them from the firebase console, however, is it possible to send them from the manager app to the main app? If not, what would I need to do in order to send them from somewhere other than the console (I don't want anyone else to have access to the console but would like them to be able to send notifications.) Thanks!
Seems like you are looking for device to device messaging. This is not currently supported by FCM, so you will need some type of server.
The server could implement XMPP in which case it can be a relay, upstream messages from admin client will be converted to downstream messages to non-admin clients.
The server could watch the Firebase Relatime Database and then the admin client could write something to the database and the server watching the database could then take action and send notifications to non-admin clients.

which database to use for android app

how can I deploy android application to receive notifications when the online database is changed?
Using a database phpmysql, how can I communicate this with my android app? Thank you all for the safe response
Try to have a look at Google Cloud Messaging, your server can push a notification to a specific device or broadcast messages to all your devices that something has happened on your server.

Categories

Resources