public override void ViewDidLoad() { base.ViewDidLoad(); NSNotificationCenter.DefaultCenter.AddObserver(new NSString("sucess_registered"), (NSNotification obj) => { _isRegistered = true; TableView.ReloadData(); }); FH.RegisterPush(HandleNotification); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); FH.RegisterPush(HandleEvent); SetContentView(Resource.Layout.messages); var emptyView = FindViewById(Resource.Id.empty); _listview = FindViewById <ListView>(Resource.Id.messages); _listview.EmptyView = emptyView; }
public override async void OnMessageReceived(string from, Bundle data) { if (!ServiceFinder.IsRegistered <IPush>()) { await FHClient.Init(); FH.RegisterPush(DefaultHandleEvent); } var push = ServiceFinder.Resolve <IPush>() as Push; var message = data.GetString("alert"); var messageData = data.KeySet().ToDictionary(key => key, key => data.GetString(key)); (push.Registration as GcmRegistration).OnPushNotification(message, messageData); }