I am new to Android and I really hope that this will be easy to solve for you guys!
I would like to allow users to send push to other users after clicking a button in my application. It configured ParsePush correctly on my button click listener because it works fine:
ParseQuery pushQuery = ParseInstallation.getQuery();
pushQuery.whereEqualTo("installationId", installationId);
ParsePush push = new ParsePush();
push.setQuery(pushQuery);
push.setMessage("HEY YOU");
push.sendInBackground();
But I would like to add a URI to my push, so I did:
ParseQuery pushQuery = ParseInstallation.getQuery();
pushQuery.whereEqualTo("installationId", installationId);
ParsePush push = new ParsePush();
push.setQuery(pushQuery);
String string = "{\"title\" : \"my title\",\"alert\" : \"my alert text\",\"uri\" : \"myapp://host/path\"}";
try {
JSONObject data = new JSONObject(string);
push.setData(data);
} catch (JSONException e) {
Log.e("MYAPP", "unexpected JSON exception", e);
}
push.sendInBackground();
In my Android manifest, I have target activity:
<activity android:name=".Accept_Action">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myapp" android:host="host" android:path="/path" />
</intent-filter>
</activity>
But for some reason this does not work. The push never lands on my target device. Can you help me do this job? Thanks
source
share