//这个启动pushservice,同时设置默认打开activity
PushService.setDefaultPushCallback(this, MainPageActivity.class);
// 保存 installation 到leancloud服务器
AVInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
@Override
public void done(AVException e) {
if (e == null) {
Log.e("保存成功:", AVInstallation.getCurrentInstallation().toString());
} else {
Log.e("保存失败:", e + "---#######---" + AVInstallation.getCurrentInstallation().toString());
}
AVInstallation.getCurrentInstallation().saveInBackground();
}
});
// 显示的设备的 installationId,用于推送的设备标示
Log.e("该设备--obj-id: " ,AVInstallation.getCurrentInstallation().toString());
Log.e("该设备--obj-id: ", AVInstallation.getCurrentInstallation().getObjectId());
这是我写在主页的与leancloud有关的,你看下,还需要什么?