Exemplo n.º 1
0
        public PushManager(ISettings settings,
                           IServiceProvider services,
                           iOSNotificationDelegate nativeDelegate) : base(settings)
        {
            this.services       = services;
            this.nativeDelegate = nativeDelegate;

            this.payloadSubj = new Subject <IDictionary <string, string> >();
        }
Exemplo n.º 2
0
 public PushManager(ISettings settings, IServiceProvider services, iOSNotificationDelegate ndelegate)
     : base(settings, services, ndelegate)
 {
     Messaging.SharedInstance.AutoInitEnabled = true;
     Messaging.SharedInstance.Delegate        = new FbMessagingDelegate
                                                (
         async msg =>
     {
         var dict = msg.AppData.FromNsDictionary();
         await services.SafeResolveAndExecute <IPushDelegate>(x => x.OnReceived(dict));
     },
         async token =>
     {
         this.CurrentRegistrationToken     = token;
         this.CurrentRegistrationTokenDate = DateTime.UtcNow;
         await services.SafeResolveAndExecute <IPushDelegate>(x => x.OnTokenChanged(token));
     }
                                                );
 }