birkir / react-native-carplay

CarPlay with React Native
https://birkir.dev/react-native-carplay/
MIT License
647 stars 107 forks source link

Carplay for ios 14 #33

Closed tomdye closed 3 years ago

tomdye commented 3 years ago

Fixes various bugs I found when using this package and adds first class support for ios14. There were a fair few breaking changes from ios13 to ios14 and it was not possible to support both 14 and < 14 within the same package so in my mind it is better to move forward with a version 2.0.0 that supports ios14 and leave the existing version 1.3.1 to support legacy ios versions.

mapTemplateNavigation
tomdye commented 3 years ago

@birkir please take a look at this and contact me if you'd like to discuss. I've used this to integrate carplay into an existing turn by turn app and got it working pretty well. These are all the bugs / tweaks I made along the way to get it running more stable and with more functionality. I think moving forward with a v2.0.0 aimed at ios14 is the best approach here.

marf commented 3 years ago

@birkir please take a look at this and contact me if you'd like to discuss. I've used this to integrate carplay into an existing turn by turn app and got it working pretty well. These are all the bugs / tweaks I made along the way to get it running more stable and with more functionality. I think moving forward with a v2.0.0 aimed at ios14 is the best approach here.

Hello @tomdye we have a music app similar to Spotify and are trying to integrate CarPlay for it. We are trying to use our fork, the problem is thank when we open the app in our simulator app does not seem to open in CarPlay and if we open it directly in CarPlay it crashes with this message:

Application does not implement CarPlay template application lifecycle methods in its scene delegate.

Are we missing something?

Thank you

birkir commented 3 years ago

This is awesome.

What was the problem with supporting ios13 with the if statements?

Runtime errors or just didn't build?

tomdye commented 3 years ago

This is awesome.

What was the problem with supporting ios13 with the if statements?

Runtime errors or just didn't build?

The biggest issue I had was the macro level conditionals in the Objective C. Essentially the PODs / build targets for your package were set to a low iOS level so when they got installed into your react native package they were compiled for the wrong target and thus the statements never got entered. I also found that the differing types / rules for the typescript side of the interface were problematic and caused problems.

TLDR: When using the package previously you could not build it to target both pre / post iOS14 so there was no point jumping through hoops and adding complexity to support it. Your app either has to support one of the other.

tomdye commented 3 years ago

@birkir please take a look at this and contact me if you'd like to discuss. I've used this to integrate carplay into an existing turn by turn app and got it working pretty well. These are all the bugs / tweaks I made along the way to get it running more stable and with more functionality. I think moving forward with a v2.0.0 aimed at ios14 is the best approach here.

Hello @tomdye we have a music app similar to Spotify and are trying to integrate CarPlay for it. We are trying to use our fork, the problem is thank when we open the app in our simulator app does not seem to open in CarPlay and if we open it directly in CarPlay it crashes with this message:

Application does not implement CarPlay template application lifecycle methods in its scene delegate.

Are we missing something?

Thank you

Did you follow the delegate steps in the Readme? https://github.com/birkir/react-native-carplay#installing

tomdye commented 3 years ago

@birkir going forward, I think it may also be worthwhile converting to swift and remove the use of the deprecated delegate - though I've not yet looked into the complexities surrounding this latter part.

tomdye commented 3 years ago

Comments addressed and prettier ran against the example dir.

marf commented 3 years ago

@birkir please take a look at this and contact me if you'd like to discuss. I've used this to integrate carplay into an existing turn by turn app and got it working pretty well. These are all the bugs / tweaks I made along the way to get it running more stable and with more functionality. I think moving forward with a v2.0.0 aimed at ios14 is the best approach here.

Hello @tomdye we have a music app similar to Spotify and are trying to integrate CarPlay for it. We are trying to use our fork, the problem is thank when we open the app in our simulator app does not seem to open in CarPlay and if we open it directly in CarPlay it crashes with this message: Application does not implement CarPlay template application lifecycle methods in its scene delegate. Are we missing something? Thank you

Did you follow the delegate steps in the Readme? https://github.com/birkir/react-native-carplay#installing

Yeah I followed them but they are several called, I read somewhere that they are used by Navigation apps only, and if you have Audio app capabilities like in my case they are not called. Maybe is this the problem?

tomdye commented 3 years ago

@marf I'm afraid that I have not looked into audio apps yet.

kevinlowen1 commented 3 years ago

@tomdye I tried using this branch's example with the instructions in the ReadMe of this branch. It doesn't seem to be working on my machine, think the instructions might need to be updated.

error message is 'React/RCTConvert.h' file not found

I also wanted to ask if you have worked on the PointofInterest screen at all? I don't see changes there but you mentioned in an issue separately that this branch would fix that screen.

tomdye commented 3 years ago

@kevinlowen1 if you already the example etc installed you may need to run rm -rf node_modules ios/Pods from the example dir before running the steps. re. POI, I'm afraid I did not look at this template yet as I was working on a navigation app for which POI is not actually a valid template. Once this PR is approved and merged I'm sure contributors like myself can look into the remaining templates currently causing issues.

birkir commented 3 years ago

I will release later today, thank you for the effort!

tomdye commented 3 years ago

@birkir I'm assuming you don't have a react-native-carplay related discord, but I'm tom#1547 if you wanted to chat at all on discord about this project and future development / releases etc.

vvusts commented 3 years ago

@tomdye @birkir sorry I don't understand. From this PR I see POI template should work on IOS 14 but it crash so is it supported or not?

tomdye commented 3 years ago

@vvusts I do not believe I was able to get POI to work when I was doing this, but I was writing a turn by turn navigation app when I was making this PR. The POI template is only valid for certain types of apps as per the apple developer guide so you may need to check that over and see if your app qualifies.