Snapchat / login-kit-sample

Sample App For Login Kit
Other
76 stars 55 forks source link

React native, building error -> "No known class method for selector 'fetchUserDataWithQuery:variables:success:failure:" #33

Open clementinoux opened 2 years ago

clementinoux commented 2 years ago

Hello,

I'm experiencing difficulties installing the "@snapchat/snap-kit-react-native" with the last version of React Native.

A constant error when building the application is showing : "No known class method for selector 'fetchUserDataWithQuery:variables:success:failure:" (LoginKitModule.m line 151)

**_"@snapchat/snap-kit-react-native": "^0.3.0",
"react": "17.0.2",
"react-native": "0.68.1",_**

👇👇👇

Screen Shot 2022-05-03 at 19 27 32

The lib works well with an older version of React native, but there is a warning on the same line : "'fetchUserDataWithQuery:variables:success:failure:' is deprecated"

_**"@snapchat/snap-kit-react-native": "^0.3.0",
"react": "16.13.1",
"react-native": "^0.63.2",**_

👇👇👇

Screen Shot 2022-05-03 at 19 33 48

Any easy fix? (me not speaking objective C/swift) 🥲 @ramanpreetSinghKhinda @safaiyeh @tphillipssc @eberglundsc @mwestergaardsc-zz

Thxxxxxxxx

lockieluke commented 2 years ago

anyone?

clementinoux commented 2 years ago

I guess downgrading the SnapSDK directly in the Podfile is a temporary work around but... you know :)

The last pod version I used which was working for me is SnapSDK 1.15.0 pod 'SnapSDK/SCSDKCoreKit', '1.15.0' pod 'SnapSDK/SCSDKLoginKit', '1.15.0' pod 'SnapSDK/SCSDKCreativeKit', '1.15.0'

lockieluke commented 2 years ago

thank you very much!

ramanpreetSinghKhinda commented 2 years ago

Hi @clementinoux ,

There are a couple of changes made in the recent version of Snap SDKs that are not ported into Snap React Native bindings.

It should not be a problem for Android because we have a fix version of Snap Android SDK with every release of React Native plugin(ref1, ref2).

However, for iOS snap-kit-react-native.podspec file adds the Snapkit SDK cocoapod as a dependency and because it doesn't have a version provided so it will download the latest available version.

I would suggest you to downgrade for now because we don't have any immediate plans to update the React Native bindings. That being said I'll ask Tamer from iOS team to see if there's something else we can do.

Note: I refer to a private branch in the comment

tamerbader commented 2 years ago

Hi @clementinoux and @lockieluke ,

We've released a new version of the @snapchat/snap-kit-react-native plugin (0.4.0). This update will force the pod install for the SnapSDK to go up to 1.15.0 which is the latest working version with our current react native bindings. We have plans in the near future to update the bindings to support up to 2.1.0. I hope this helps unblock anyone who may have been facing this same issue.