0
Ich möchte unterscheiden, ob App als Antwort auf den RemoteNotification-Klick aktiviert wurde. Wie geht das ?Überprüfen, ob App wegen RemoteNotification aktiv wurde (App wurde bereits gestartet)
Ich möchte unterscheiden, ob App als Antwort auf den RemoteNotification-Klick aktiviert wurde. Wie geht das ?Überprüfen, ob App wegen RemoteNotification aktiv wurde (App wurde bereits gestartet)
Sie können es wie dieses
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSDictionary *notification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (notification) {
// it's launch from notification
}
else
{
// normal launch on app icon click
}
}
für eine schnelle plz Verwendung dieses
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if (launchOptions?[UIApplicationLaunchOptionsKey.remoteNotification] as? NSDictionary) != nil {
// it's launch from notification
}
else
{
// normal launch on app icon click
}
// Override point for customization after application launch.
return true
}