2016-04-19 12 views
0

Ich lade Freunde ein, die Anwendung über den FBSDKAppInviteDialog des Facebook SDK zu verwenden.FBSDKAppInviteDialog, Neustart der App beim Verlassen

let inviteDialog:FBSDKAppInviteDialog = FBSDKAppInviteDialog() 
    if(inviteDialog.canShow()){ 
     let content = FBSDKAppInviteContent() 
     content.appLinkURL = NSURL(string: "xxxxxxxx") 
     content.appInvitePreviewImageURL = NSURL(string: "xxx") 
     inviteDialog.delegate = self 
     inviteDialog.fromViewController = self 
     inviteDialog.content = content 
     inviteDialog.show() 
    } 

Und die Delegatmethoden:

extension InviteFriendsEmailViewController: FBSDKAppInviteDialogDelegate{ 
func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didCompleteWithResults results: [NSObject : AnyObject]!) { 
} 
func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didFailWithError error: NSError!) { 
}} 

Alles funktioniert einwandfrei, außer dass, wenn die Einladungen werden (erfolgreich) geschickt, ich bin in dem Anfang UIViewController meine Storyboard umgeleitet .. I don‘ Ich weiß warum. Wie wenn die Anwendung neu gestartet wird.

Gibt es jemanden, der mir helfen könnte?

Vielen Dank im Voraus! Ben

Antwort

0

Eigentlich war das Problem, dass, wenn Sie die FBSDKAppInviteDialog verlassen, sind Sie die AppDelegate Funktion eingeben:

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool { 

Und in dieser Funktion habe ich einige dynamische Links wurde das Parsen und einige andere UIViewControllers öffnen!

Hope this jemand helfen ^^

Bye!

Verwandte Themen