android - Parse app's id and client key - android

I am working right now on a tutorial to send push notifications in android.
here is the link - https://parse.com/tutorials/android-push-notifications.
In the tutorial, it says -
// -------------------------------- TUTORIAL -------------------------- //
Create or open your Application class, and add the following line to your onCreate method:
Parse.initialize(this, "YOUR_APP_ID", "YOUR_CLIENT_KEY");
Make sure to replace "YOUR_APP_ID" and "YOUR_CLIENT_KEY" with your Parse app's id and client key. You can find these in your app's Settings page.
// -------------------------------- TUTORIAL -------------------------- //
My question is - where do I get those app's id and client key?
and also, maybe there is an easier way to send push notifications from my application? what is classic way to send push notifications in android?.
by push notifications I mean notification that will appear in the phone even when the app is closed, like email notification for example, or whatsapp.
thanks a lot!

In the parse dash board will find the required keys in the keys tab. Please refer the image below

Related

Push Notifications in WebView android app

I have a requirement where I want to send push notifications to the user.
For example
the app will have 2 users. If user 1 send a friend request to user 2
then user 2 should get a notification like " You got friend request
from user 1" and when user 2 clicks on that notification he should
able to see the user 1 profile.
I know how to do all these with the activities but here I am using web view, so please help me to solve with this. Any help is appreciable.
You can always access your Java code trough javascrtipt running on the web page your WebView is presenting. You can define a Java method (which sends the notification through your backend) and call it from your custom javascript.
Take a look at https://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)

How to send an Android Push Message using Intels App-Framework?

I'm looking for a solution to send a Push Message from PHP in Intels App-Framework, but I can't find any good solution. I have found this:
https://gist.github.com/prime31/5675017
But how can I get the DEVICE_REGISTRATION_ID? It's very difficult to find some code or solution.
Ive found the Solution. I have forgott to type the IP 0.0.0.0/0 into the Google API Console. And i added the Google API Key and Projectnumber by the Push Category on Build Window.
Then i copy paste the code from http://docs.appmobi.com/index.php/push-messages/ into index_user_scripts.js (only number 2 and 3). Number 1 goes to index.html on the header section. Now it works fine, i can send messages from the Services Tab.

Rich push in Urbanairship in android

I am implementing Push Notification for Android in my project. I am implementing urbanairship GCM push Notification.While i gone through the urbanairship site, i camr to notice that under the messages tab, there is an option for "TEST RICH PUSH". I have already done tested simple push by sending push messages from "TEST PUSH" under the tab messsages. Now my question is in "TEST RICH PUSH", there are two new fields "USER" and "ALIAS". Is Rich push is used for sending push notification only to a particualar user currently using an App. or it has got any other purpose. Also please let me know how to enable "RICH PUSH" in their new website.(Earlier it is staright forward. Now i looked in their whole website, But i couldn't find a clue). Any help in this is highly appreciated.`
Thanks InAdvance
Rich Push is automatically apart of the Urban Airship library (at least since 3.0.0 version, probably before then as well but I'm not sure which version number). There are just a few things in code you have to do to get it up and started.
In your airshipconfig.properties file add the line "richPushEnabled = true" (without quotes).
In your manifest file add a service with the name "com.urbanairship.richpush.RichPushUpdateService" along with the PushService/PushWorkerService, etc.
And you should be good to go! If not let me know I may have forgotten something.
To send a push you have to use the curl command found here (Under Rich Push -> Rich Push broadcast): https://support.urbanairship.com/customer/portal/articles/1069013-helpful-curl-examples under audience instead of doing "all", spit out this value to the logs somewhere once UA is initialized: RichPushManager.shared().getRichPushUser().getId() (import com.urbanairship.richpush.*;) and make sure the MasterSecret parameter is NOT your api secret but the master secret found in your API keys on your UA developer dashboard.
I wrote everything out because Urban Airship's documentation DNE for android Rich Pushes, it's absolutely horrible. They have a sample project but that's it.

Push Messages for PhoneGap

I created an app for iPhone and Android using Phonegap.
Now I wanted to add push functionality which already works pretty good.
When a push message arrives on my iPhone I get a message on the homescreen. If I swipe it, iOS will open my application. - So far so good.
Now, within my PhoneGap app I need to check what that message actually says in order to open the correct view within my app via JavaScript.
I know there are quite some posts about this but I couldn't find some clear answers to these questions:
Does PhoneGap support push messages?
If yes, where is the documentation for that?
If not, which plugins/frameworks can be recommended? So far I found pushwoosh and Urbanair. Are they any good?
Regarding Pushwoosh, I noticed that I need some kind of pushwoosh ID - Why that?
By Pushwoosh ID you most probably mean Pushwoosh App Id or Application Code. It's an ID of your application in Pushwoosh Control Panel (current format is XXXXX-XXXXX). You will see it as soon as you add a new app in Pushwoosh.
There was quite an extensive blog post made by Holly Schinsky on easy PhoneGap integration with Pushwoosh
http://devgirl.org/2012/12/04/easy-phonegap-push-notifications-with-pushwoosh/
It should be very helpful for all PhoneGap developers aiming to integrate push notifications into their apps.
I found a really easy solution without using a framework.
I simply added the following code to the very end of the method didFinishLaunchingWithOptions (Right before the return statement):
if (launchOptions != nil)
{
NSDictionary* dictionary = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (dictionary != nil)
{
NSLog(#"Launched from push notification: %#", dictionary);
[self addMessageFromRemoteNotification:dictionary updateUI:NO];
}
}
Also, I added this new method to my AppDelegate.m which gets the payload from the push message:
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo
{
NSLog(#"Received notification: %#", userInfo);
[self addMessageFromRemoteNotification:userInfo updateUI:YES];
}
(The NSLog calls above will show you what's inside the push message)
As a last step, I added this listener to do what ever I want with the payload:
- (void)addMessageFromRemoteNotification:(NSDictionary*)userInfo updateUI:(BOOL)updateUI
{
// do what ever you want with userInfo
}
If you want to do an additional JavaScript call with this info, I recommend using:
[self.viewController.webView stringByEvaluatingJavaScriptFromString:#"callSomeJSFunction()"];
Of course you can also pass arguments as strings into that JS function if you want.

Google cloud messenging for android

I've just started with Google Cloud Messenging with phonegap and I'm in an android virtual device.
For the client side app ,I chosed to go with this tutorial : https://github.com/marknutter/GCM-Cordova .
For the server side app ,I created a servlet containing the default code from google (see the last section) : http://developer.android.com/guide/google/gcm/gs.html
For the client app, I just want to make sure where to put exactly the sender id ,the tutorial say that i should place it where ever i find "your_sener_id" in the plugin file code ,but I cant find any string matching "your_sender_id".
-for the server side app,I have 2 little problems :
Here see a variable named "device" should i replaced it with the sender id too ?
import com.google.android.gcm.server.*;
Sender sender = new Sender(myApiKey);
Message message = new Message.Builder().build();
MulticastResult result = sender.send(message, devices, 5);
-for "gcm-server.jar" ,I've tried to download it with sdk manager but the links i've added could not be feched
.I tried also to download it directy from the net but my server wasn't happy with it
thanks for anyhelp and sorry for my bad english.

Categories

Resources