Hello and thank you for downloading the plugin,
This output doesn’t seem to be wrong…
The plugin assumes that the user has been subscribed to the broadcast channel.
Is there any chance that in your iOS app, the users are subscribed in a channel named something different than “” ?
Hi,
thank’s a lot for your work!
My users aren’t subscribed to a channel
http://screencloud.net/v/cXnQ
i’ve solved by changing the array on $data
$data = array(
'where' => '{}',
'expiry' => 1451606400,
'data' => array(
'alert' => $AlertMessage,
'badge' => $Badge,
),
);
Nice! I’ll work on an update with the ability to set custom channel or no channel.
Thanks for your feedback!
Plugin Hello, and installed. I could not send push notifications, but thanks to Salvatore can already do.
My question is: When I post an entry, send push notifications to mobile.
But I can do so that when users click, fence to the website where this article?
My code is as follows:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Parse.initialize(this, "xxxxxxxxxxxxxxxxxxxxxxx",
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy");
PushService.setDefaultPushCallback(this, MainActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
init();
}
Thanks, and sorry for the English.
@f3ernan: If you require assistance then, as per the Forum Welcome, please post your own topic.
Hi and thanks for your support!
As i can see you’re on Android so i cannot help you much because it’s more about Android development and i didn’t have the chance to do much on this area.
But, as i think parse’s documentation is pretty good. Take a look here https://parse.com/docs/push_guide#receiving-responding/Android.
As you can see, application receives a JSONObject
which you have to parse and get all the info.
This plugin adds to the payload an extra key-value pair with the key name “post_id”.
So, in order to get the post_id
you’re using the same way you use to get the title
from the JSON payload.
After that and assuming your post_id is equal to 15, using the url ....your-wordpress-website.com/?p=15&feed=rss&withoutcomments=1
you get your article’s feed and do whatever you want.
If you don’t want the feed, the url then is ....your-wordpress-website.com/?p=15
Hope that helps.
Hello again. sorry for being heavy. But not much programming. I’m just an amateur.
Regarding what dtsolis commented, this code is the example of Parse.com
That would have to change parameters here to receive the URL of the post and open the browser?
The plugin works great.
Thank you again.
@Override
public void onReceive(Context context, Intent intent) {
try {
String action = intent.getAction();
String channel = intent.getExtras().getString("com.parse.Channel");
JSONObject json = new JSONObject(intent.getExtras().getString("com.parse.Data"));
Log.d(TAG, "got action " + action + " on channel " + channel + " with:");
Iterator itr = json.keys();
while (itr.hasNext()) {
String key = (String) itr.next();
Log.d(TAG, "..." + key + " => " + json.getString(key));
}
} catch (JSONException e) {
Log.d(TAG, "JSONException: " + e.getMessage());
}
}
}
In this while
function
while (itr.hasNext()) {
String key = (String) itr.next();
Log.d(TAG, "..." + key + " => " + json.getString(key));
}
You could do something like this
while (itr.hasNext()) {
String key = (String) itr.next();
if ( key.equals("post_id") ) {
int post_id = json.getInt(key);
// ...do whatever you want with the post_id
}
Log.d(TAG, "..." + key + " => " + json.getString(key));
}