我想知道pushwoosh系统是如何工作的。用户启动应用的前两次时,将执行 doOnRegister() 处理程序。在前两次之后,这种情况不再发生。
另一个大问题是我需要获取我的标签,但没有办法知道经理是否已注册。因此,前两次,在注册管理器之前(因此在调用doOnRegister之前)调用方法UserController.Instance.GetPushwooshTags(ApplicationContext)中的异步方法的处理程序。我该如何解决这个问题?
我做了什么:https://www.pushwoosh.com/programming-push-notification/android/android-additional-platforms/xamarin-android/
我在活动中做这样的事情:
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.mainAppActivity);
mMessageReceiver = new LocalMessageBroadcastReceiver ();
mMessageReceiver.activity = this;
mRegisterReceiver = new LocalRegisterBroadcastReceiver ();
mRegisterReceiver.activity = this;
ArelloMobile.Push.PushManager manager = ArelloMobile.Push.PushManager.GetInstance (this);
manager.OnStartup (this);
//Register for push!
manager.RegisterForPushNotifications();
checkMessage (Intent);
//this method calls pushManager.GetTagsAsync(context,listener);
UserController.Instance.GetPushwooshTags (ApplicationContext);
}
public void doOnRegistered(String registrationId)
{
Console.WriteLine ("registered for pushwoosh");
// code to run if device has succesfully registered
}
您的应用是否收到推送?您是否在 http://cp.pushwoosh.com 测试过?如果没有,您还应该检查此文档:GCM 配置和最重大的变化