Skip to content

Commit

Permalink
add version guard
Browse files Browse the repository at this point in the history
  • Loading branch information
benbahrenburg committed Apr 27, 2015
1 parent ca8083c commit 408a524
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iphone/Classes/TiApp.m
Expand Up @@ -484,14 +484,14 @@ - (void) application:(UIApplication *)application handleActionWithIdentifier:(NS
}


#pragma mark Apple Watch
#pragma mark Apple Watchkit handleWatchKitExtensionRequest
- (void)application:(UIApplication *)application
handleWatchKitExtensionRequest:(NSDictionary *)userInfo
reply:(void (^)(NSDictionary *replyInfo))reply
{

// Generate unique key with timestamp.
id key = [NSString stringWithFormat:@"watch-reply-%f",[[NSDate date] timeIntervalSince1970]];
id key = [NSString stringWithFormat:@"watchkit-reply-%f",[[NSDate date] timeIntervalSince1970]];

if (pendingReplyHandlers == nil) {
pendingReplyHandlers = [[NSMutableDictionary alloc] init];
Expand Down
8 changes: 8 additions & 0 deletions iphone/Classes/TiAppiOSProxy.m
Expand Up @@ -551,13 +551,21 @@ -(void)didRegisterUserNotificationSettingsNotification:(NSNotification*)notifica
withObject:[self formatUserNotificationSettings:(UIUserNotificationSettings*)[notificationSettings object]]];
}

#pragma mark Apple Watchkit notifications

-(void)didReceiveWatchExtensionRequestNotification:(NSNotification*)notif
{
[self fireEvent:@"watchkitextensionrequest" withObject:[notif userInfo]];
}

#pragma mark Apple Watchkit handleWatchKitExtensionRequest reply

-(void)sendWatchExtensionReply:(id)args
{
if(![TiUtils isIOS8OrGreater]) {
return;
}

enum Args {
kArgKey = 0,
kArgCount,
Expand Down

0 comments on commit 408a524

Please sign in to comment.