0

ここで明らかな何かが欠けているに違いありません...以前、次のコードを使用して、アプリから Facebook にメッセージを投稿しました。過去に addURL 呼び出しを介して割り当てられた URL は、Facebook の投稿のヘッダーの URL として表示されました。以下のコードの場合、アプリ ストア内のアプリへのリンクが提供されます。

ただし、Xcode 5 では、同じことを試してみると、投稿ダイアログが開き、URL として渡されたものがすぐに開きます。この場合、それは私のアプリから App Store に移動することを意味します。その後、App Store は、ユーザーが既に私のアプリをインストールしていることをユーザーに通知します...その後、アプリに戻ると、投稿ダイアログがまだ開いていて、投稿を続けることができます...もちろん、ユーザーを追い出しますそもそも、ここで意図されているものとは正確には異なります...

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) //check if Facebook Account is linked
{
    SLComposeViewController *mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; //Tell him with what social plattform to use it, e.g. facebook or twitter
    NSString *body = @"";
    for (SpelledWord *thisWord in wordList) {
        body = [NSString stringWithFormat:@"%@%@\n", body, thisWord.word];
    }
    if ([[GameState sharedGameState] gameRunState] == kUserPaused) {
        [mySLComposerSheet setInitialText:[NSString stringWithFormat:@"I'm Playing String Theory: a Word Game\n\nWord List so Far:\n%@",body]]; //the message you want to post
    } else {
        [mySLComposerSheet setInitialText:[NSString stringWithFormat:@"I just played String Theory: a Word Game and got a score of %i\n\nFinal Word List:\n%@",[GameState sharedGameState].score,body]]; //the message you want to post
    }

    [mySLComposerSheet addURL:[NSURL URLWithString:deepLinkStoreBitly]];
    [self presentViewController:mySLComposerSheet animated:YES completion:nil];
}
4

0 に答える 0