Skip to content

Instantly share code, notes, and snippets.

@rogerhu
Last active October 10, 2017 09:59
Show Gist options
  • Save rogerhu/8093311f8bdeeefc075ee12a5252a8a7 to your computer and use it in GitHub Desktop.
Save rogerhu/8093311f8bdeeefc075ee12a5252a8a7 to your computer and use it in GitHub Desktop.
Push Testing
// See https://github.com/rogerhu/parse-server-push-marker-example/blob/master/cloud/main.js#L43-L66
// for corresponding server code.
public class PushTest {
public static void sendPushTest() {
JSONObject payload = new JSONObject();
try {
payload.put("sender", ParseInstallation.getCurrentInstallation().getInstallationId());
} catch (JSONException e) {
e.printStackTrace();
}
HashMap<String, String> data = new HashMap<>();
data.put("customData", payload.toString());
ParseCloud.callFunctionInBackground("pingReply", data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment