【发布时间】:2015-09-17 11:09:45
【问题描述】:
对不起我的英语。你能告诉我我怎么能喜欢这样:我已经锁定了手机,如果在手机锁定其节目时推送通知(就像你接到电话一样)。我使用 Parse.com
这是我的设置:
// Initialize Crash Reporting.
ParseCrashReporting.enable(this);
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
// Add your initialization code here
Parse.initialize(this, "-", "-");
//ParseInstallation.getCurrentInstallation().saveInBackground();
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// Optionally enable public read access.
// defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
清单
<receiver android:name="----Receiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
接收者
@Override
public void onPushOpen(Context context, Intent intent) {
ParseAnalytics.trackAppOpenedInBackground(intent);
//String uriString = null;
try {
Bundle extras = intent.getExtras();
if (extras != null) {
String jsonData = extras.getString("com.parse.Data");
JSONObject json;
Log.e("json", json.toString());
}
} catch (JSONException e) {
e.printStackTrace();
}
}
【问题讨论】:
标签: android parse-platform push