ios icon indicating copy to clipboard operation
ios copied to clipboard

Where can I put this code?

Open waheedshabeer opened this issue 4 years ago • 1 comments

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... // Define UNUserNotificationCenter UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self;

    return YES; }

//Called when a notification is delivered to a foreground app. -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler { completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge); }

waheedshabeer avatar Feb 25 '21 21:02 waheedshabeer

didFinishLaunchingWithOptions already exists in your AppDelegate.m file, so add the

UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;

lines before the return statement and for the other method just make sure its under @implementation AppDelegate

yabsi avatar Mar 02 '21 23:03 yabsi