Example #1
0
        public static Task <PlayerIds> IdsAvailableAsync(this IOneSignal @this)
        {
            var tcs = new TaskCompletionSource <PlayerIds>();

            @this.IdsAvailable((playerId, pushToken) => tcs.SetResult(new PlayerIds(playerId, pushToken)));
            return(tcs.Task);
        }
Example #2
0
        public static Task <Dictionary <string, object> > GetTagsAsync(this IOneSignal @this)
        {
            var tcs = new TaskCompletionSource <Dictionary <string, object> >();

            @this.GetTags(tags => tcs.SetResult(tags));
            return(tcs.Task);
        }
 public UserDevicesController(IRepository <UserDevice> userDevicesRepo,
                              ILogHelper logHelper,
                              IOneSignal oneSignal)
 {
     _userDevicesRepo = userDevicesRepo;
     _logHelper       = logHelper;
     _oneSignal       = oneSignal;
 }
Example #4
0
        public static Task <OneSignalResponse> LogoutEmailAsync(this IOneSignal @this)
        {
            var tcs = new TaskCompletionSource <OneSignalResponse>();

            @this.LogoutEmail(
                () => tcs.SetResult(new OneSignalResponse(true, null)),
                response => tcs.SetResult(new OneSignalResponse(false, response)));
            return(tcs.Task);
        }
Example #5
0
        public static Task <OneSignalResponse> SetEmailAsync(this IOneSignal @this, string email, string emailAuthToken)
        {
            var tcs = new TaskCompletionSource <OneSignalResponse>();

            @this.SetEmail(email, emailAuthToken,
                           () => tcs.SetResult(new OneSignalResponse(true, null)),
                           response => tcs.SetResult(new OneSignalResponse(false, response)));
            return(tcs.Task);
        }
Example #6
0
        public static Task <OneSignalResponse> PostNotificationAsync(this IOneSignal @this, Dictionary <string, object> data)
        {
            var tcs = new TaskCompletionSource <OneSignalResponse>();

            @this.PostNotification(data,
                                   response => tcs.SetResult(new OneSignalResponse(true, response)),
                                   response => tcs.SetResult(new OneSignalResponse(false, response)));
            return(tcs.Task);
        }
Example #7
0
 public NotificationHelper(IUserRepository userRepo,
                           IRepository <Notification> notificationRepo,
                           IRepository <UserDevice> userDeviceRepo,
                           IRepository <UserSetting> userSettingRepo,
                           IOneSignal oneSignal)
 {
     _userRepo         = userRepo;
     _notificationRepo = notificationRepo;
     _userDeviceRepo   = userDeviceRepo;
     _userSettingRepo  = userSettingRepo;
     _oneSignal        = oneSignal;
 }
 public DashboardController(IRepository <User> userRepo,
                            IRepository <UserDevice> userDeviceRepo,
                            ICommentRepository commentRepo,
                            IEventOperationRepository eventOperationRepo,
                            IOneSignal oneSignal,
                            ILogHelper logHelper)
 {
     _userRepo           = userRepo;
     _commentRepo        = commentRepo;
     _userDeviceRepo     = userDeviceRepo;
     _eventOperationRepo = eventOperationRepo;
     _oneSignal          = oneSignal;
     _logHelper          = logHelper;
 }
Example #9
0
 public OneSignalBuilder(IOneSignal parent)
 {
     DisplayOption = OSInFocusDisplayOptionEnum.InAppAlert;
     _parent       = parent;
 }