简体   繁体   中英

Integrating Snapchat “Snap Kit” Login Kit in iOS

I am trying to integrate the Snapchat Login Kit into my iOS app and am running into problems with authenticating through the web and redirecting in both app and web format.

I was following this tutorial: https://medium.com/adventures-in-ios-mobile-app-development/snapchat-snap-kit-sdk-tutorial-for-ios-swift-311863074bab

Here is my project: https://github.com/josh10237/Faxx

When I run on an emulator (that doesn't have Snapchat installed) I get this error:

objc[17265]: Class SCSDKCertificateTrust is implemented in both /Users/joshbenson/Library/Developer/CoreSimulator/Devices/66F76A7D-BB4C-4556-A401-10EA15A08DB1/data/Containers/Bundle/Application/065DF16F-AD5B-4B2B-BF66-6FE11538AE8C/faxx.app/Frameworks/SCSDKLoginKit.framework/SCSDKLoginKit (0x1025cfc08) and /Users/joshbenson/Library/Developer/CoreSimulator/Devices/66F76A7D-BB4C-4556-A401-10EA15A08DB1/data/Containers/Bundle/Application/065DF16F-AD5B-4B2B-BF66-6FE11538AE8C/faxx.app/Frameworks/SCSDKCoreKit.framework/SCSDKCoreKit (0x10258c158). One of the two will be used. Which one is undefined.
objc[17265]: Class SCSDKCertPinningHandler is implemented in both /Users/joshbenson/Library/Developer/CoreSimulator/Devices/66F76A7D-BB4C-4556-A401-10EA15A08DB1/data/Containers/Bundle/Application/065DF16F-AD5B-4B2B-BF66-6FE11538AE8C/faxx.app/Frameworks/SCSDKLoginKit.framework/SCSDKLoginKit (0x1025cfc58) and /Users/joshbenson/Library/Developer/CoreSimulator/Devices/66F76A7D-BB4C-4556-A401-10EA15A08DB1/data/Containers/Bundle/Application/065DF16F-AD5B-4B2B-BF66-6FE11538AE8C/faxx.app/Frameworks/SCSDKCoreKit.framework/SCSDKCoreKit (0x10258c1a8). One of the two will be used. Which one is undefined.
2020-07-15 12:19:00.609082-0700 faxx[17265:876600] [SnapKit] path=/v1/config trace_id=2A1162C3A2614AB2AF014E7BBA74EBC5
2020-07-15 12:19:01.138241-0700 faxx[17265:876597] [SnapKit] Dynamic config update status: success
TAPPED
2020-07-15 12:19:02.397957-0700 faxx[17265:876408] -canOpenURL: failed for URL: "snapchat://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"

And then when I try to click on the continue button it does not do anything. This is what the screen looks like: here . But then I when I run it on my device (which has Snapchat installed), I am able to log in and it even redirects back to my app, but I get this error:

objc[10201]: Class SCSDKCertificateTrust is implemented in both /private/var/containers/Bundle/Application/3712A2D0-3F4F-4739-BB94-548E9DC4200F/faxx.app/Frameworks/SCSDKLoginKit.framework/SCSDKLoginKit (0x102c23af8) and /private/var/containers/Bundle/Application/3712A2D0-3F4F-4739-BB94-548E9DC4200F/faxx.app/Frameworks/SCSDKCoreKit.framework/SCSDKCoreKit (0x102ad70c8). One of the two will be used. Which one is undefined.
objc[10201]: Class SCSDKCertPinningHandler is implemented in both /private/var/containers/Bundle/Application/3712A2D0-3F4F-4739-BB94-548E9DC4200F/faxx.app/Frameworks/SCSDKLoginKit.framework/SCSDKLoginKit (0x102c23b48) and /private/var/containers/Bundle/Application/3712A2D0-3F4F-4739-BB94-548E9DC4200F/faxx.app/Frameworks/SCSDKCoreKit.framework/SCSDKCoreKit (0x102ad7118). One of the two will be used. Which one is undefined.
2020-07-15 12:25:23.097183-0700 faxx[10201:2778821] [SnapKit] path=/v1/config trace_id=484613DFB37D4AD18027527FD9542058
2020-07-15 12:25:23.631449-0700 faxx[10201:2778821] [SnapKit] Dynamic config update status: success
TAPPED
2020-07-15 12:25:31.322429-0700 faxx[10201:2778820] [SnapKit] path=/v1/sdk/metrics/business trace_id=890EF31D286548C3AF57254B490BEA35
2020-07-15 12:25:34.347608-0700 faxx[10201:2778823] [] nw_read_request_report [C2] Receive failed with error "Software caused connection abort"
2020-07-15 12:25:34.347928-0700 faxx[10201:2778823] [] nw_read_request_report [C1] Receive failed with error "Software caused connection abort"
2020-07-15 12:25:34.348197-0700 faxx[10201:2778823] [] nw_read_request_report [C2] Receive failed with error "Software caused connection abort"
2020-07-15 12:25:34.354865-0700 faxx[10201:2778823] [] nw_read_request_report [C1] Receive failed with error "Software caused connection abort"

When the user is authenticated, (through browser or app) I want them to be redirected to the WelcomeController view and a way to access their data (ie display name, bitmoji, etc). Cheers!

The issue with the simulator not responding may be the issue I'm having ( SnapKit login fails after upgrading from 1.3.2 to 1.6.5 (SCSDKLoginClient.application() returns false) ).

this may be a bug in the Snapchat SDK.

It looks like this worked on the sim until version 1.6.2. 1.6.3 and later (through 1.6.5 currently) are failing.

BTW, your sample project doesn't seem to be accessible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM