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

CarPlay app fails to load unless the app is already open on the mobile device #149

Open
harrymash2006 opened this issue Oct 13, 2023 · 8 comments

Comments

@harrymash2006
Copy link

I am testing this on iOS simulator and also I tested the same on the real CarPlay in a car and the behaviour is same.

@harrymash2006
Copy link
Author

@DanielKuhn @birkir any clue about this?

@DanielKuhn
Copy link
Contributor

My understanding is that react native always needs a native bridge to work.
The bridge is usually created in the AppDelegate but when starting a CarPlay-app without launching the app first, you need to create the bridge in the CarScene.
I pasted my native code in this issue. For my case it works for starting the app on CarPlay directly.

@harrymash2006
Copy link
Author

@DanielKuhn tried same scene files from podverse project but I am still getting the blank screen. I get this message in bundler Running "App" with {"rootTag":1,"initialProps":{}} in terminal but still it shows blank screen on CarPlay

@DanielKuhn
Copy link
Contributor

Sorry, I'm at a loss here. My advice would be: Try stripping away all code that is unrelated to startup and add line-by-line debugging.

@elieT27
Copy link

elieT27 commented Oct 20, 2023

My understanding is that react native always needs a native bridge to work. The bridge is usually created in the AppDelegate but when starting a CarPlay-app without launching the app first, you need to create the bridge in the CarScene. I pasted my native code in this issue. For my case it works for starting the app on CarPlay directly.

Could someone maybe update de readm, so we can know that a bridge need to be created and how thank you

@mursang
Copy link

mursang commented Nov 8, 2023

I got it working following this comment:
#109 (comment)
(Changed swift code in my project to the one in the pull request)

Now Carplay can be opened without the need of the app. However, I'm facing a different issue with react native navigation that I still need to fix.

@DanielKuhn
Copy link
Contributor

DanielKuhn commented Nov 21, 2023

After fiddling around with this topic for quite some time now, always in doubt of what's happening under the hood and seeing ever more questions around starting on CarPlay without having the app running on phone, I took the liberty to create (and document!) an example app which runs independently of the phone app and supports launching on CarPlay directly (without having the phone app running) in this PR: #158
Patches welcome, feel free to add comments and improvements.

@DanielKuhn
Copy link
Contributor

My understanding is that react native always needs a native bridge to work. The bridge is usually created in the AppDelegate but when starting a CarPlay-app without launching the app first, you need to create the bridge in the CarScene. I pasted my native code in this issue. For my case it works for starting the app on CarPlay directly.

Could someone maybe update de readm, so we can know that a bridge need to be created and how thank you

@elieT27 I added a description of my understanding of rootViewController, rootView and window creation in the README of my new example app

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

4 participants