watchOS2在本地通知点击上获取活动

时间:2015-09-28 15:42:23

标签: ios objective-c xcode notifications watch-os-2

当我在手表上点击LocalNotification的主体时,我没有得到任何活动。

我在ExtensionDelegate.m文件中有以下处理程序:

@implementation ExtensionDelegate

- (void)applicationDidFinishLaunching {
    // Perform any final initialization of your application.
}

- (void)applicationDidBecomeActive {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillResignActive {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, etc.
}

#pragma mark - Notifications
- (void)handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)localNotification {
    NSLog(@"Identifeir: %@, localNotif: %@", identifier, localNotification);
}

- (void)handleUserActivity:(NSDictionary *)userInfo {
    NSLog(@"User Info: %@", userInfo);
}

- (void)handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)remoteNotification {
    NSLog(@"Identifeir: %@, remoteNotif: %@", identifier, remoteNotification);
}

- (void)handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)localNotification withResponseInfo:(NSDictionary *)responseInfo {
    NSLog(@"Identifeir: %@, localNotif: %@, responseInfo:%@", identifier, localNotification, responseInfo);
}

@end

这些事件都没有被调用。我该怎么办?

0 个答案:

没有答案