Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth.authorize() crashes the app #7

Open
oogunjob opened this issue Oct 1, 2024 · 8 comments
Open

Auth.authorize() crashes the app #7

oogunjob opened this issue Oct 1, 2024 · 8 comments

Comments

@oogunjob
Copy link

oogunjob commented Oct 1, 2024

Every single time I try to use this function the app crashes. Here is the function that I have created that is called whenever the user pressed a button.

    const onAuth = () => {
        Auth.authorize()
        .then((status) => console.log('Authorize:', status))
        .catch(console.error);
    };

I'm using Expo but I've created a development build in order to install the necessary native modules and packages. Been struggling with this all day and I've already tried removing and re-installing the nodule_modules folder. Has anyone else ran into this issue or know how to resolve it?

@MatthewPattell
Copy link

Every single time I try to use this function the app crashes. Here is the function that I have created that is called whenever the user pressed a button.

    const onAuth = () => {
        Auth.authorize()
        .then((status) => console.log('Authorize:', status))
        .catch(console.error);
    };

I'm using Expo but I've created a development build in order to install the necessary native modules and packages. Been struggling with this all day and I've already tried removing and re-installing the nodule_modules folder. Has anyone else ran into this issue or know how to resolve it?

Could you please provide:

  • Expo version
  • Xcode version
  • React native version

Also, do you tried too catch crash message through xcode?

@oogunjob
Copy link
Author

oogunjob commented Oct 11, 2024

@MatthewPattell @trusasha @Pashkagreen
Expo version: 51.0.37
React native version: 0.74.5

More details if needed:
System:
OS: Windows 11 10.0.22631
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Memory: 622.48 MB / 7.65 GB
Binaries:
Node:
version: 20.10.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.22
path: ~\AppData\Roaming\npm\yarn.CMD
npm:
version: 10.8.2
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowAllTrustedApps: Disabled
Versions:
- 10.0.22621.0
IDEs:
Android Studio: AI-241.15989.150.2411.11948838
Visual Studio: Not Found
Languages:
Java:
version: 17.0.10
path: /c/Program Files/Common Files/Oracle/Java/javapath/javac
Ruby:
version: 3.2.3
path: C:\Ruby32-x64\bin\ruby.EXE
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.74.5
wanted: 0.74.5
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: Not found

I'm not using Xcode, I'm developing on Windows but I've been creating a development build after installing your library

@MatthewPattell
Copy link

@oogunjob be noticed, this library supports only IOS

@oogunjob
Copy link
Author

oogunjob commented Oct 14, 2024

Hello @MatthewPattell , I've only been using it on iOS. The thing that also has been confusing me is that there's not even an option for me to provide or initialize my Apple developer token for the MusicKit API.

I've again created a dev build since I am using Expo which performs the pod-install for me, but could the reason for the instant crash be because there is no place for me to input the developer token?

Could you please provide a code example or a video demonstrating what is supposed to happen? I've been stuck on this addition for weeks :(

@MatthewPattell
Copy link

Hello @MatthewPattell , I've only been using it on iOS. The thing that also has been confusing me is that there's not even an option for me to provide or initialize my Apple developer token for the MusicKit API.

I've again created a dev build since I am using Expo which performs the pod-install for me, but could the reason for the instant crash be because there is no place for me to input the developer token?

Could you please provide a code example or a video demonstrating what is supposed to happen? I've been stuck on this addition for weeks :(

You don't need provide any developer tokens. Please take a look at example.
Here is example: https://github.com/Lomray-Software/react-native-apple-music/tree/prod/example

Also I would recommend you run it in Xcode and take a look at crash logs.

PS: Make sure what you have this key in yout Info.plist:

<key>NSAppleMusicUsageDescription</key>
<string>Allow to continue</string>

@oogunjob
Copy link
Author

oogunjob commented Oct 14, 2024

"ios": { "infoPlist": { "NSAppTransportSecurity": { "NSAllowsArbitraryLoads": true }, "NSLocationWhenInUseUsageDescription": "Location based notifications based on events happening in your area", "NSAppleMusicUsageDescription": "Listen to music while you browse" }, "runtimeVersion": { "policy": "appVersion" } },

Also here is my expo build properties setting the deployment build for iOS to 16
[ "expo-build-properties", { "android": { "compileSdkVersion": 34, "targetSdkVersion": 34, "buildToolsVersion": "34.0.0" }, "ios": { "deploymentTarget": "16.0" } } ],

I've added the key there as well in my app.json file. And unfortunately I do not have a MacOS machine to run Xcode. Another person I know who is also working on the app with this library in expo is experiencing the same crashes.

@oogunjob
Copy link
Author

@MatthewPattell

@MatthewPattell
Copy link

@oogunjob I advise you to find mac and debug it through xcode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants