Tag: parse.com

如何知道Parse.initialize()何时被调用?

现在我使用静态布尔值来判断初始化是什么时候发生的。 有没有更简单的方法来知道我已经调用了初始化? 谢谢!!! 解决了!!!! 非常感谢你的评论。 您需要在扩展应用程序的类中初始化解析,然后将其作为应用程序(而不是其他活动)添加到清单文件中。 🙂 这是我使用Parse的类: package com.example.myapp; import com.parse.Parse; import android.app.Application; public class UseParse extends Application { @Override public void onCreate() { super.onCreate(); Parse.initialize(this, “id”, “key”); } } 这是我的android清单文件 //… more

我无法在Parse的应用程序中收到推送通知

我在我的应用程序中配置了Parse API,除推送通知外,一切正常。 我试图从网站发送它们,但他们没有到达应用程序。 我做了文档中写的所有内容 ,但我无法收到通知推送。 我能够收到一个,当我按下它应用程序崩溃。 现在我试图改变一些东西,但即使扭转我也不能再收到它们了。 我该如何解决我的问题? 编辑:由于一些用户可能感兴趣,这是我用于推送通知的代码的部分: 主类(不是MainActivity): public class InstantsApplication extends Application { public void onCreate() { super.onCreate(); // Hidden Parse.initialize(this, “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”, “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”); ParseInstallation.getCurrentInstallation().saveInBackground(); ParsePush.subscribeInBackground(“”, new SaveCallback() { @Override public void done(ParseException e) { if (e == null) { Log.d(“com.parse.push”, “successfully subscribed to the broadcast channel.”); } else { Log.e(“com.parse.push”, “failed to […]

android使用parse.com api通过推送通知实现聊天

我正在做一个聊天应用程序。 在应用程序中,我必须使用解析andorid sdk与推送通知的帮助聊天。 我成功地在不同用户之间生成推送通知。 但是无法接收推送并在列表视图中添加其数据。 这是maifest文件的代码 和我的自定义接收器的代码 public class MyCustomReceiver extends BroadcastReceiver { private static final String TAG = “MyCustomReceiver”; @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, “”+intent, Toast.LENGTH_LONG).show(); } } 从java代码我发送像这样的推送: ParseQuery query = ParseInstallation.getQuery(); query.whereEqualTo(“device_id”, target); ParsePush push = new ParsePush(); push.setQuery(query); push.setMessage(message); push.setExpirationTimeInterval(86400); push.sendInBackground(); 请告诉我使用接收器接收数据的错误,以及当我接受推送时该怎么做意味着任何逻辑或想法进一步移动。 提前致谢