1

我需要知道如何打开我的 iphone 的父应用程序。我有一块1.0.1 版本的手表,父应用程序有8.4 iOS

这是我在AppDelegate

 __block UIBackgroundTaskIdentifier bogusWorkaroundTask;
    bogusWorkaroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
        [[UIApplication sharedApplication] endBackgroundTask:bogusWorkaroundTask];
    }];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [[UIApplication sharedApplication] endBackgroundTask:bogusWorkaroundTask];
    });
    // --------------------

这就是我回复信息的方式:

    if ([[userInfo objectForKey:@"request"] isEqualToString:@"program"]) {
        __block UIBackgroundTaskIdentifier realBackgroundTask;
        realBackgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
            reply(nil);
            [[UIApplication sharedApplication] endBackgroundTask:realBackgroundTask];
        }];
        // Kick off a network request, heavy processing work, etc.
        // Return any data you need to, obviously.
        [WatchRequestsHandler handleCurrentProgramRequestWithReply:reply];
        [[UIApplication sharedApplication] endBackgroundTask:realBackgroundTask];

        NSLog(@"Reply :: %@ ", reply);
    } else if([[userInfo objectForKey:@"request"] isEqualToString:@"programs"]){

        __block UIBackgroundTaskIdentifier realBackgroundTask;
        realBackgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
            reply(nil);
            [[UIApplication sharedApplication] endBackgroundTask:realBackgroundTask];
        }];
        // Kick off a network request, heavy processing work, etc.
        // Return any data you need to, obviously.
        [WatchRequestsHandler handleProgramsRequestWithReply:reply];
        [[UIApplication sharedApplication] endBackgroundTask:realBackgroundTask];

        NSLog(@"Reply :: %@ ", reply);
    } 

但是我的父应用程序没有打开。

我的错误是什么!请帮忙

4

0 回答 0