Skip to content

Commit

Permalink
Merged PR 15311: Update iOS GraphNotificationsSample for v1.3.2
Browse files Browse the repository at this point in the history
Update iOS GraphNotificationsSample for v1.3.2
  • Loading branch information
Sudipta Dey (WDG) committed May 3, 2019
1 parent 1fa3b96 commit e3af7b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ - (void)application:(__unused UIApplication*)application

#if TARGET_OS_SIMULATOR
// Simulator doesn't support APNS, use polling mode to run this sample
[self _initPlatformManager];
[_platformManager setNotificationRegistration:@"GraphNotificationsSamplePolling"];
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,11 @@ - (instancetype)init {
}

- (NotificationsManager*)notificationsManager {
// Since the sample is setup for single account, return the first account's notifications manager
return self.accounts[0].notificationsManager;
if (self.accounts.count > 0) {
// Since the sample is setup for single account, return the first account's notifications manager
return self.accounts[0].notificationsManager;
}
return nil;
}

- (NSMutableArray<Account*>*)deserializeAccounts {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ - (void)_updateView {

- (IBAction)refresh {
[self _initNotificationsManager];
[_notificationsManager refresh];
if (_notificationsManager != nil) {
[_notificationsManager refresh];
}
}

- (NSInteger)numberOfSectionsInTableView:(__unused UITableView*)tableView {
Expand Down

0 comments on commit e3af7b4

Please sign in to comment.