3

I am using Xcode 11.3.1 and try to login with snapchat with loginkit I add the add information in info.plist and my code is

  SCSDKLoginClient.login(from: self, completion: { success, error in

                        if let error = error {
                            print(error.localizedDescription)
                            return
                        }

                        if success {
                            self.fetchSnapUserInfo() //example code
                        }
                    })

this code show me the login ui of snapchat and I am login into snapchat with my account. but I am stuck on this ui enter image description here

when I am click on continue nothing is happing . SCSDKLoginClient completion block not called.

Cœur
  • 37,241
  • 25
  • 195
  • 267
balkaran singh
  • 2,754
  • 1
  • 17
  • 32

2 Answers2

0

Please ensure your URL scheme is configured correctly.

URL Schemes

Peter
  • 68
  • 9
0

hello everyOne soo finally i found the solution

i am using 11.3.1 and when i create new project the add AppDelegate and SceneDelegate default class.

so according to snapchat logkit documentation i add

  func application(_ app: UIApplication,
                       open url: URL,
                       options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
          return SCSDKLoginClient.application(app, open: url, options: options)
      }

method in my Appdelegate class. but this method never get called in xocode 11.3.1 so the solution of my problem is this

 func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
   guard let url = URLContexts.first?.url else {
       return
   }

     SCSDKLoginClient.application( UIApplication.shared, open: url, options: nil)
    }

you need to add this method into your sceneDelegate file. then everything work fine. synpchat need to update there doc for new xcode 11.3.1. i hope this answer help you guy's because i also wast my 3 day's on this issue. happy Coding :)

balkaran singh
  • 2,754
  • 1
  • 17
  • 32
  • I tried your solution and it worked but unfortunately `SCSDKLoginClient.application( UIApplication.shared, open: url, options: nil)` this code does not authenticate the user in. How did you solve it? – airsoftFreak May 02 '20 at 03:02
  • @airsoftFreak i am not understand your point . can you explain it ? – balkaran singh May 04 '20 at 07:44