FRANotificationGateway.m revision 6c1420dd55f69d09f39dd213ee6c97ba901b8d92
0N/A * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
6983N/A * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
0N/A@interface FRANotificationGateway ()
5636N/A@property (nonatomic, strong) void (^registrationHandler)(NSString *registrationToken, NSError *error);
0N/A/*! GCM registration options (holds APNS deviceId and prod/dev flag) - will be removed when switching to Amazon SNS */
@end
if (self) {
return self;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// (parses the GoogleService-Info.plist, and initializes the services that have entries in the file)
UIRemoteNotificationType allNotificationTypes = (UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge);
UIUserNotificationType allNotificationTypes = (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
return YES;
if (error) {
// XXX: Also need to implement method to see what notification types have been permitted and respond accordingly
// e.g. show a warning to user if notifications disabled and a push authn mechanism has been registered
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
_registrationOptions = @{
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
- (void)application:(UIApplication *)application handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler {
- (void)registerGcmSenderId {
- (void)onTokenRefresh {
@end