Free Teachnology provide free #PHP,#MySql,#Javascript,#jQuery,#API integration,#Payment gateway integration,#Social Media login
Firebase Cloud Messaging
Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably deliver messages at no cost.
Using FCM, you can notify a client app that new email or other data is available to sync. You can send notification messages to drive user re-engagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app
IOS Setup link :
https://firebase.google.com/docs/cloud-messaging/ios/client
Andriod Link :
https://firebase.google.com/docs/cloud-messaging/android/client
Web Link :
https://firebase.google.com/docs/cloud-messaging/js/client
How does it work?
Firebase Cloud Messaging architecture diagram
An FCM implementation includes two main components for sending and receiving:
A trusted environment such as Cloud Functions for Firebase or an app server on which to build, target, and send messages.
An iOS, Android, or web (JavaScript) client app that receives messages.
You can send messages via the Admin SDK or the HTTP and XMPP APIs.
mplementation path
Set up the FCM SDK :
Set up Firebase and FCM on your app according to the setup instructions for your platform.
Develop your client app :
Add message handling, topic subscription logic, or other optional features to your client app. During the development, you can easily send test messages from the Notifications composer.
Develop your app server :
Decide whether you want to use the Admin SDK or one of the server protocols to create your sending logic—logic to authenticate, build sendrequests, handle responses, and so on. Then build out the logic in your trusted environment. Note that if you want to use upstream messaging from your client applications, you must use XMPP, and that Cloud Functions does not support the persistent connection required by XMPP.
Andriod Notification :
Set Up a Firebase Cloud Messaging Client App on Android
To write your Firebase Cloud Messaging Android client app, use the FirebaseMessaging API and Android Studio 1.4 or higher with Gradle. The instructions in this page assume that you have completed the steps for adding Firebase to your Android project.
FCM clients require devices running Android 4.0 or higher that also have the Google Play Store app installed, or an emulator running Android 4.0 with Google APIs. Note that you are not limited to deploying your Android apps through Google Play Store.
Set up Firebase and the FCM SDK
If you haven't already, add Firebase to your Android project.
In Android Studio, add the FCM dependency to your app-level build.gradle file:
implementation 'com.google.firebase:firebase-messaging:17.0.0'
Andriod app FCM notification :
Please follow following link to implemetation:
https://firebase.google.com/docs/cloud-messaging/android/client
Setting Up a Firebase Cloud Messaging Client App on iOS :
For iOS client apps, you can implement Firebase Cloud Messaging in two complementary ways:
Receive basic push messages up to 4KB over the Firebase Cloud Messaging APNs interface.
Send messages upstream and/or receive downstream data payloads up to 4KB in foregrounded apps.
To write your client code in Objective-C or Swift, we recommend that you use the FIRMessaging API. The quickstart example provides sample code for both languages.
Please follow following link of URL :
https://firebase.google.com/docs/cloud-messaging/ios/client
Add Firebase to your app
It's time to add Firebase to your app. To do this you'll need a Firebase project and a Firebase configuration file for your app.
To create a Firebase project:
Create a Firebase project in the Firebase console, if you don't already have one. Click Add project. If you already have an existing Google project associated with your mobile app, select it from the Project name drop down menu. Otherwise, enter a project name to create a new project.
Optional: Edit your Project ID. Your project is given a unique ID automatically, and it's used in publicly visible Firebase features such as database URLs and your Firebase Hosting subdomain. You can change it now if you want to use a specific subdomain.
Follow the remaining setup steps and click Create project (or Add Firebase if you're using an existing project) to begin provisioning resources for your project. This typically takes a few minutes. When the process completes, you'll be taken to the project overview.
IOS Notification in php using CURL call :
hope that you better understand above boostrap datepicker tutorial if you have any query please mail on : disuzajen@gmail.com
Firebase Cloud Messaging
Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably deliver messages at no cost.
Using FCM, you can notify a client app that new email or other data is available to sync. You can send notification messages to drive user re-engagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app
IOS Setup link :
https://firebase.google.com/docs/cloud-messaging/ios/client
Andriod Link :
https://firebase.google.com/docs/cloud-messaging/android/client
Web Link :
https://firebase.google.com/docs/cloud-messaging/js/client
How does it work?
Firebase Cloud Messaging architecture diagram
An FCM implementation includes two main components for sending and receiving:
A trusted environment such as Cloud Functions for Firebase or an app server on which to build, target, and send messages.
An iOS, Android, or web (JavaScript) client app that receives messages.
You can send messages via the Admin SDK or the HTTP and XMPP APIs.
mplementation path
Set up the FCM SDK :
Set up Firebase and FCM on your app according to the setup instructions for your platform.
Develop your client app :
Add message handling, topic subscription logic, or other optional features to your client app. During the development, you can easily send test messages from the Notifications composer.
Develop your app server :
Decide whether you want to use the Admin SDK or one of the server protocols to create your sending logic—logic to authenticate, build sendrequests, handle responses, and so on. Then build out the logic in your trusted environment. Note that if you want to use upstream messaging from your client applications, you must use XMPP, and that Cloud Functions does not support the persistent connection required by XMPP.
Andriod Notification :
Set Up a Firebase Cloud Messaging Client App on Android
To write your Firebase Cloud Messaging Android client app, use the FirebaseMessaging API and Android Studio 1.4 or higher with Gradle. The instructions in this page assume that you have completed the steps for adding Firebase to your Android project.
FCM clients require devices running Android 4.0 or higher that also have the Google Play Store app installed, or an emulator running Android 4.0 with Google APIs. Note that you are not limited to deploying your Android apps through Google Play Store.
Set up Firebase and the FCM SDK
If you haven't already, add Firebase to your Android project.
In Android Studio, add the FCM dependency to your app-level build.gradle file:
implementation 'com.google.firebase:firebase-messaging:17.0.0'
Andriod app FCM notification :
$msg='hi how are you';
$kye="xxxxxxxxxxxxxxxxxxx";
$token="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$res = array(); $res['data']['title'] = "xxxxxx"; $res['data']['is_background'] = "xxxxxx"; $res['data']['message'] = "" . $msg . ""; $res['data']['payload'] = "payload"; $res['data']['timestamp'] = date('Y-m-d H'); $res['data']['icon'] = "ic_launcher"; $res['data']['color'] = "#374a96"; $res['data']['click_action'] = "action_tag"; $fields = array( 'to' => $token, 'data' => $res, ); $url = 'https://fcm.googleapis.com/fcm/send'; $headers = array( 'Authorization: key=$kye', 'Content-Type: application/json' ); // Open connection $ch = curl_init(); // Set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Disabling SSL Certificate support temporarly curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); // Execute post $result = curl_exec($ch);
Please follow following link to implemetation:
https://firebase.google.com/docs/cloud-messaging/android/client
Setting Up a Firebase Cloud Messaging Client App on iOS :
For iOS client apps, you can implement Firebase Cloud Messaging in two complementary ways:
Receive basic push messages up to 4KB over the Firebase Cloud Messaging APNs interface.
Send messages upstream and/or receive downstream data payloads up to 4KB in foregrounded apps.
To write your client code in Objective-C or Swift, we recommend that you use the FIRMessaging API. The quickstart example provides sample code for both languages.
Please follow following link of URL :
https://firebase.google.com/docs/cloud-messaging/ios/client
Add Firebase to your app
It's time to add Firebase to your app. To do this you'll need a Firebase project and a Firebase configuration file for your app.
To create a Firebase project:
Create a Firebase project in the Firebase console, if you don't already have one. Click Add project. If you already have an existing Google project associated with your mobile app, select it from the Project name drop down menu. Otherwise, enter a project name to create a new project.
Optional: Edit your Project ID. Your project is given a unique ID automatically, and it's used in publicly visible Firebase features such as database URLs and your Firebase Hosting subdomain. You can change it now if you want to use a specific subdomain.
Follow the remaining setup steps and click Create project (or Add Firebase if you're using an existing project) to begin provisioning resources for your project. This typically takes a few minutes. When the process completes, you'll be taken to the project overview.
IOS Notification in php using CURL call :
$msg='hi how are you';
$serverkey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
//token generated from ios app
$token="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$kye="xxxxxxxxxxxxxxxxxxx";
#API access key from Google API's Console define( 'API_ACCESS_KEY', $serverkey ); $registrationIds = $token;
#prep the bundle $msg = array ( 'body' => 'Body Of Notification', 'title' => 'Title Of Notification', 'icon' => 'myicon',/*Default Icon*/ 'sound' => 'mySound'/*Default sound*/ ); $fields = array('to' => $registrationIds,'notification' => $msg); $headers = array('Authorization: key=' . API_ACCESS_KEY,'Content-Type: application/json'); #Send Reponse To FireBase Server $ch = curl_init(); curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' ); curl_setopt( $ch,CURLOPT_POST, true ); curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false ); curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) ); $result = curl_exec($ch ); curl_close( $ch ); #Echo Result Of FireBase Server echo $result;
hope that you better understand above boostrap datepicker tutorial if you have any query please mail on : disuzajen@gmail.com
Comments