BimmerGestalt / AAIdrive

Implementations of some Android Auto features as unofficial IDrive apps
MIT License
541 stars 90 forks source link

Fix integration with the new "My BMW" app #239

Closed dimakaob closed 3 years ago

dimakaob commented 3 years ago

Hello! There is this new application "My bmw" instead of the old "Connected". Are you planning to update AndroidAutoidrive?
Thank you.

hufman commented 3 years ago

Good morning! This app requires two main pieces of functionality from the Connected app: The Apps tunnel to connect to the car, and the Security module to authenticate to the car. "My BMW" has its security module in a slightly different place, so I added support for it on November 23rd The app will use whichever Apps tunnel starts up on the phone. At that time, My BMW didn't enable the Apps connection to the car, but I'm hearing reports that it works now. If My BMW does start the Apps tunnel, this app should automatically use it. Any of the automatic builds since November should include support, if the underlying Apps tunnel is present. If you are running the last Release from August, try out the latest build instead.

fabssor commented 3 years ago

So for me, it is working fine with the MyBMW app. But for now, as described in #238 you need to start AndroidAutoIDrive manually each time. Spotify etc. should then show up.

LACNR commented 3 years ago

Since the latest Update for MyBMW the two older Connected Apps don't seem to acknowledge the connection to the car, my phone doesn't either and even on manual start up no connection can be made, not even AAiD App. In car when I tried to manually run the connection assistant it tells me I have to download the Connected App, which I of course have. My phone can still be identified as a storage medium in the Media/External Devices menu though.

I deinstalled MyBMW and restarted my phone but nothing seems to help, I believe the latest Update of MyBMW disabled the old apps, because when starting the previous Connected App it tells that the App will be deactivated on June 30th.

Anyone having similar trouble?

fabssor commented 3 years ago

@LACNR Be sure that you have only installed one BMW App. For you this means onyl install the MyBMW App and deinstall the "old" Connected App. Greetings!

LACNR commented 3 years ago

@fabssor

It worked always fine having all three BMW installed before until I updated MyBMW yesterday, because the MyBMW offers not much functionality it is basically useless for me or does it also have Calendar and more like the previous Connected Apps including the classic?

fabssor commented 3 years ago

Ah no I also noticed today that the calendar feature is nor supported by MyBMW.

But maybe thus will be added by BMW later again 🤷

LACNR commented 3 years ago

I was eventually able to fix it more or less, I deinstalled the previous new Connected App and then reinstalled it. Upon first connection I had to select the default BMW App either Connected or Connected Classic.

I selected as usually the later Connected App, because it used to connect with both Apps anyways, but it didn't work no connection, then I choose to delete the default startup and reconnected, this time I selected the Connected Classic App as default and it immediatly connected to the car, everything functional from the Connected Classic (News, Audioplayer, Calendar, Wiki Local, ECO Pro Analyser) app and the apps supported by AAiDrive. The latest Connected App is not connecting though yet, my car still suggest me to install the Connected App when I run the in-car connectivity assistent although it does connect with the Classic Connected App automatically. Indeed it seems the latest Connected App (Black and Light Blue globe) must been messed up by My BMW or support has been removed earlier.

This might be important information for everyone to not install/update MyBMW and eventually needs further research whats happening.

jof284 commented 3 years ago

Seems there is like a built-in verification process in the latest BMW and MINI Connected apps where it seems that if verification fails (maybe if the date is later than a defined date) it refuses to connect. The way you can workaround this for now is with the latest Connected app stop the app, clear the cache and data and then put the phone in airplane mode, connect to the car (I tested via USB) and it should connect just fine. The first time you open the Connected app it will refuse to connect again so I would just leave it without credentials and it connects just fine in subsequent attempts even with the phone online.

dimakaob commented 3 years ago

Hi there. Today at the morning tried this latest build. Works fine so far. Will try later at the evening. Thank you!

P.S. So glad you fixed the album icon. Different background color from August release freaked me out. %D

dimakaob commented 3 years ago

Well, just tested again. Everything works just perfect! And I noticed, that now my car can see the messages from Instagram, or from Google. Wow!!! Is there any chance to get Whatsapp or Viber messages?

LACNR commented 3 years ago

I can use AutoiDrive as usual before but only with the Connected Classic App which isn't available on the app stores anymore, the newer Connected App doesn't seem to recognize the car anymore and vice versa nor via Bluetooth/USB, the MyBMW does notify that Bluetooth Connection to the car has been made but due to the lack functionality I don't see if the MyBMW app has an affect and functions over the original Connected Classic app.

My assume is, the current Connected App is now no longer functional in the car? I will ask my friends if they have similar problems but also ask in the BMW forums.

@dimakaob I could read and see all kinds of messages such WhatsApp, Insta, Facebook, Weather, Messenger and so on since at least the August release (first time I got this AAiDrive super awesome app). So it should work for you too, although I installed the new build yesterday things might have changed.

hufman commented 3 years ago

@LACNR I'm guessing that BMW changed a server-side setting and flipped everyone's Connected 6.5 to this promotional mode, disabling the car app functionality this week. There's a link in #238 to download the previous Connected 6.4, which should restore the functionality for you. The BMW app's notification displays if a Bluetooth Music connection is made to a device with a name that starts with BMW or MINI (perhaps also verifying that the Bluetooth provides the SPP support for the car protocol), but is otherwise unrelated to the status of the car app connection. In my tests, this notification remains if you uncheck the Apps option in the car. For further information, you can look at the advanced Connection tab in the app, which shows performance details about the BCL Tunnel, including whether it is actively running. From what I'm seeing in the code, MyBMW now only includes a car application to read data from the CDS, perhaps providing the car information data for cars that aren't cloud connected. And so, the only real clue that MyBMW is connected over the app protocol is that this BCL Tunnel Statistics panel shows active data.

@dimakaob AAI has supported displaying your phone notifications (including messages) in the car for a long time (via the unlabeled book icon). However, this current version has a ton of improvements in this area, such as adding new messages to an ID5 car's Notification Center, which is a little more prominent and displays the statusbar icon if the app decided to not trigger a popup for the notification. I'm glad you like it :)

dimakaob commented 3 years ago

But still i can't get notifications from Whatsapp and Viber =((( Can you tell me where i should check? I have

  1. Access to notifications
  2. Access to SMS notifications
    • pop up notifications
      • pop ip notifications with the passenger (what is it?)
  3. Play the notification sound
  4. Speak the displayed notification
  5. Speak new notifications and fast replies
LACNR commented 3 years ago

@hufman

Thank you :) , too bad that BMW did that, but I will try out the 6.4 and downloaded it for later.

@dimakaob It should work right away when you have enabled all notifications at least 1. and 2. I think Pop up notifications with passenger is when your BMW has the option enhanced bluetooth connectivity allowing two phones being paired to the car via bluetooth at the same time to receive calls, play music and so on. You will also a second microphone on the passenger side.

dimakaob commented 3 years ago

@LACNR Thank you! It's funny, but here is what i did. I started my car and ask my friend to send me an instagram message. Notification worked fine. Then i asked him to send me a Viber message. Nothing. The radio was on. Then i switched to Spotify. And then asked again. And i got the Viber message! Then i switched back to radio and it still works fine. Hooray!

hufman commented 3 years ago

@dimakaob Where are you looking for these messages? If you go into the unlabeled book icon in the Online Services menu, you should see a live-updating list of all notifications currently displayed on your phone. If the Viber message was received, and is showing on the phone's notification list, it should show up here right away.

@LACNR The Show Popups With Passenger option is something simpler than that: The car tells the app whether someone is sitting in the front passenger seat, and this option is used to show or not-show new notification popups while a passenger is detected.

DominikS66 commented 3 years ago

@hufman on my car (F20 2019, ID6) AndroidAutoIdrive stopped working this week due to the issue you mentiond before. Solution which works for me at this time: I installed both MyBMW and BMW Connected App on Smartphone (Samsung S9), but never started BMW Connected App, only MyBMW to connect to the car. With this workaround, the actual AndroidAutoIDrive release (1.2.2) is working again. But it would be nice to get a new release of AndroidAutoIDrive with MyBMW App support soon (or I should make my own apk..)

LACNR commented 3 years ago

@DominikS66

Hey 😉

If you download the latest build https://androidautoidrive.s3.amazonaws.com/hufman/AndroidAutoIdrive/androidautoidrive-latest-master-nomap-sentry-release.apk MyBMW should work on its own but it doesn't launch AutoiDrive, you will need to open it manually, whenever you establish a connection.

Which brings me to the question, with you not being logged in in the Connected App, does AutoiDrive launches on its own when using MyBMW or do you have to open it yourself.

dimakaob commented 3 years ago

@LACNR I don't launch anything manually. Just start the engine.

LACNR commented 3 years ago

@dimakaob When you use the Connected Apps they start and launch AutoiDrive automatically, but people reported (and as hufman is stating in his description) that MyBMW doesn't launch AAiD automatically, so I assumed that is still the case. Apparently, using MyBMW as the main, and Connected only being installed but not logged in it works automatically, if anyone can approve on that?

DominikS66 commented 3 years ago

@LACNR AndroidAutoIDrive launches automatic at my Smartphone with this workaround. But after installing the latest master it doesn't automatic start AutoIDrive any more, even after uninstalling and installing AndroidAutoIDrive 1.2.2 Release and BMW Connected App...

dimakaob commented 3 years ago

I have only the new My bmw app and the latest build AAI. Works great without any movements..

LACNR commented 3 years ago

Going back to Version 6.4- of Connected does re-establish the connectivity with the Connected App and it works in cooperation with Connected Classic. MyBMW might will be attractive once it becomes more compatible with older model years and adds at least internal apps such as the BMW Calendar. MyBMW does recognize a connection to my BMW just fine but I can't tell if it is functional over the Connected apps.

But we are heading somewhere and there some solutions at this point.

TBGR commented 3 years ago

MyBMW does not work for me. Probably because it asks for a VIN to add the vehicle and my car came out of the factory with a CCC headunit. Rolling back to 6.4 of Connected is business as usual.

DominikS66 commented 3 years ago

After installing latest built (from tonight ?) and grant access to notifications for AAID, automatic start of AAID works with the MyBMW app.

TBGR commented 3 years ago

After installing latest built (from tonight ?) and grant access to notifications for AAID, automatic start of AAID works with the MyBMW app.

Probably, but the app connection does not start. Always running the latest build.

daniel1v commented 3 years ago

I have only the new My bmw app and the latest build AAI. Works great without any movements..

For me it is the same. I am using My BMW with latest AndroidAutoIdrive since a couple of days and it works perfectly. Everything starts and connects with the phone inside my pocket. Even after a phone restart and without any manual starting of My BMW or AndroidAutoIdrive. The connection is established a few seconds after the bluetooth connection and it is very stable.

Maybe everyone should double check to disable battery optimization for the new My BMW App.

hufman commented 3 years ago

I haven't fixed anything yet 😅 Still working on it!

daniel1v commented 3 years ago

@hufman yes, I know, I have always an eye on your latest commits. 😀

Just wanted to let you know, that there are indeed cases, where it works and that there is maybe (?) nothing to fix on your side.

At least for my HW/SW combination, the whole connection process works automatically and reliably, without unlocking the phone.

LACNR commented 3 years ago

Could it be that BMW's after MY2017 don't require an USB connection for the BMW Apps connectivity therefor MyBMW might be only optimized for Bluetooth connection right now, models before MY2017 require an USB connection to have BMW Apps, while MyBMW does detect the Bluetooth connection to your BMW regardless the model year it might not be able to make AAID launch itself because it would not recognize the USB connection for the BMW Apps feature. BMW Connected is fitted for both, USB and Bluetooth, MyBMW may not.

I haven't tried it with MyBMW only, but maybe others can fill in the gap.

DominikS66 commented 3 years ago

@hufman this is an interesting issue that you didn't change anything...for your information, there's a binary difference in apk file content between the file I've downloaded on Saturday morning 10:43 CEST and Sunday morning 07:22 CEST, using the link https://androidautoidrive.s3.amazonaws.com/hufman/AndroidAutoIdrive/androidautoidrive-latest-master-nomap-sentry-release.apk: grafik There's a version difference, -403 to -404

hufman commented 3 years ago

Yes, I merged in an updated Spanish translation #242, which wouldn't have any impact on the connection logic :)

DominikS66 commented 3 years ago

@hufman ok now I tested the security setting for notifications access (the second thing I've changed yesterday). And I found out that on my Galaxy S9 automatic start of AAID on bluetooth connection to car only works if AAID has been granted access rights to notifications. This behavior is reproducible on my Smartphone. Maybe this is an important information for other users here.

daniel1v commented 3 years ago

I haven't tried it with MyBMW only, but maybe others can fill in the gap.

So when you write, you did not try it with My BMW only, do you mean, you had BMW Connected and MyBMW installed?

I am asking this, because I remember there were issues in the past, where both apps 'fought' for the connection what lead to connection issues.

LACNR commented 3 years ago

I haven't tried it with MyBMW only, but maybe others can fill in the gap.

So when you write, you did not try it with My BMW only, do you mean, you had BMW Connected and MyBMW installed?

Yes, I have all three apps, Connected, Connected Classic and MyBMW installed because primarily I'm focused on using Connected Classic (and BMW Connected) as of now because MyBMW doesn't show me car data in the app, also it doesn't have the extra BMW apps such as the calendar. That's why I didn't test out MyBMW alone, although when I connect it to my car all three BMW apps give the notification that they are connected to the BMW.

Btw, what does "Force Audio Focus via USB connection" means?

hufman commented 3 years ago

"Force Audio Focus via USB" means to tell the car to listen to the USB apps connection for audio, even if the phone doesn't seem to support outputting audio through it. The car will behave like the app has audio focus, and the Media hardware button will go back to the Audioplayer app, but the music will likely come out of your phone speakers.

hufman commented 3 years ago

I've uploaded a build to test a workaround. This method attempts to start the app's MainService when the Bluetooth connection to the car connects, and then it will do the same probing process as when opening the UI to manually start the connection. I'd greatly appreciate your assistance in testing this approach, especially if you are using only MyBMW and the automatic connection isn't working for you, especially if you didn't enable Notification Access (which includes a separate workaround already). The method I'm using to start the MainService from the background needs me to show a notification, and I technically do, but then hide it right away until the connection is finalized, and so I'd like confirmation that this approach works well.

So far, it feels like My BMW connects the Bluetooth Apps to the car faster than BMW Connected, has anyone else noticed this too?

daniel1v commented 3 years ago

I've uploaded a build to test a workaround. This method attempts to start the app's MainService when the Bluetooth connection to the car connects, and then it will do the same probing process as when opening the UI to manually start the connection. I'd greatly appreciate your assistance in testing this approach, especially if you are using only MyBMW and the automatic connection isn't working for you, especially if you didn't enable Notification Access (which includes a separate workaround already). The method I'm using to start the MainService from the background needs me to show a notification, and I technically do, but then hide it right away until the connection is finalized, and so I'd like confirmation that this approach works well.

So far, it feels like My BMW connects the Bluetooth Apps to the car faster than BMW Connected, has anyone else noticed this too?

I torally can confirm this. It connects faster and the app connection is also more reliably and stable, then the Connected App.

fabssor commented 3 years ago

I've uploaded a build to test a workaround. This method attempts to start the app's MainService when the Bluetooth connection to the car connects, and then it will do the same probing process as when opening the UI to manually start the connection. I'd greatly appreciate your assistance in testing this approach, especially if you are using only MyBMW and the automatic connection isn't working for you, especially if you didn't enable Notification Access (which includes a separate workaround already). The method I'm using to start the MainService from the background needs me to show a notification, and I technically do, but then hide it right away until the connection is finalized, and so I'd like confirmation that this approach works well.

So far, it feels like My BMW connects the Bluetooth Apps to the car faster than BMW Connected, has anyone else

Works like a charm! Thank you so much Walter! Yes I also noticed that the Bluetooth Apps connect faster. Maybe because the BMW Apps (like calender) are not included?!

DominikS66 commented 3 years ago

I've uploaded a build to test a workaround. This method[...] So far, it feels like My BMW connects the Bluetooth Apps to the car faster than BMW Connected, has anyone else noticed this too?

I've tested the built and AAID is started automatic now no matter if access to nofications is granted or not. So your changes are working. And I can also confirm that the MyBMW app is connecting faster via bluetooth and it seems the bluetooth connection is working more reliable than with BMW connected app.

LACNR commented 3 years ago

Do you all require an USB connection for the BMW Apps integration (models before 2017) or do you have the bluetooth apps integration and only need to connect via bluetooth to have Spotify, Apple Music,... when using Connected and specifically for this case MyBMW?

The question is if MyBMW supports apps integration via USB which was needed for models before 2017 where you have to connect your phone via USB to be able to use the BMW Apps and other third-party-apps.

daniel1v commented 3 years ago

Do you all require an USB connection for the BMW Apps integration (models before 2017) or do you have the bluetooth apps integration and only need to connect via bluetooth to have Spotify, Apple Music,... when using Connected and specifically for this case MyBMW?

The question is if MyBMW supports apps integration via USB which was needed for models before 2017 where you have to connect your phone via USB to be able to use the BMW Apps and other third-party-apps.

I have a newer model with blueooth app support.

drm87 commented 3 years ago

The question is if MyBMW supports apps integration via USB which was needed for models before 2017 where you have to connect your phone via USB to be able to use the BMW Apps and other third-party-apps.

I have an ID4 car where the apps connections is only supported over USB and I tested it over the weekend. The new MyBMW app seems to not support the USB connection at all (easy to identify: when I plug the phone in, it is not suggested by the Android USB connection dialog). The old Connected app did also drop/deactivate support and shows the "switch to the new app" information.

I needed to switch back to Connected 6.4. Now everything works again.

LACNR commented 3 years ago

The question is if MyBMW supports apps integration via USB which was needed for models before 2017 where you have to connect your phone via USB to be able to use the BMW Apps and other third-party-apps.

I have an ID4 car where the apps connections is only supported over USB and I tested it over the weekend. The new MyBMW app seems to not support the USB connection at all (easy to identify: when I plug the phone in, it is not suggested by the Android USB connection dialog). The old Connected app did also drop/deactivate support and shows the "switch to the new app" information.

I needed to switch back to Connected 6.4. Now everything works again.

I thought so, that was my fear. Even, going back to the 6.4 Version is only a workaround until June 30th, when the Connected App will deactivated completely, I assume the only longterm fix would be switching to the Connected Classic app which is not using a login to BMW servers. Maybe, we can get BMW to add USB connectivity.

Although MyBMW does recognize the car when connected via Bluetooth at least it says Connected with BMW in the notifications tab, I fear it doesn't matter much to the car and the functions. Did the USB + Bluetooth combo with the latest build help out?

desertspotter commented 3 years ago

I can also confirm that the new build is working fine (MY21 F22, ID6) without notification access, and no bmw connected app installed. My only issue now is #217 , AAI doen't close Spotify connection, but just in case, the app works fine

Regarding USB and my app, I cannot test that case in my car, but for me, connected 6.4 was functional over the weekend without login in the app, at least my user/pass was not recognized but the app enabled app functionality and establish connection with AAI. I guess that if BMW don't release app over usb functionality before June you'll be still able to use 6.4 without login.

hufman commented 3 years ago

Thank you so much for the feedback! I'll keep this in mind as I phrase the new text and buttons to complete MyBMW support.

I believe, though would like confirmation before officially recommending it, that earlier versions of BMW Connected are able to launch the car connection even before logging in to Connected Drive. (As I type this, I see desertspotter's comment suggesting that 6.4 works in this way) Even if they disable logging in from BMW Connected to shut down the older app, this may be a workable solution for ID4 users. Does ID4 even still support the remote functionality that MyBMW is based around? Connected Classic seemed to interact poorly with modern Android's process killer, though it otherwise has some great functionality, and I definitely intend to continue supporting it!

LACNR commented 3 years ago

Yeah, if that would still work even if they shut down the Connected App that would be great although it is a chance to notify BMW that they need to add USB compatibility to read car data such as fuel, mileage and total distance - there are hundred thousands of cars that rely on the USB connectivity and they even say the App is optimized for vehicles since 2014.

True, I have to disable Connected Classic via apps manager because it needs alot of battery after usage but otherwise as you said great functionality.

Yes, ID4 (MY2016) still supports the remote services just reordered the service today. Although, BMW Online might not be functional towards the end of this year (germany) as providers planned to shutdown 3G, unless it runs on 4G despite saying 3G in the upper left corner.

hufman commented 3 years ago

I updated this branch's build to improve the UI text about MyBMW being supported, check it out! I think it's pretty much ready to merge, if it all checks out.

LACNR commented 3 years ago

I did some testing and I can confirm as well that if you go back to Connected 6.4 and do not login into the app with your account, the car will still recognize the app and connect with the car to use the Calendar, BMW Connected Destinations and of course the added apps via AAiD.

I also noticed MyBMW does recognize and notifies you on the phone with a PopUp that it is connected to your BMW when you connect via USB only, meaning it does support USB and Bluetooth connection independend from each other, although it doesn't seem to be able reading the car data via USB nor Bluetooth, unless it reads it real-time via on-the-air for newer models.

Since MyBMW does notify me that it is connected to my BMW when I connect via USB only (strangely it says it is Connected via Bluetooth when it isn't lol) there must be a way to use this for AAiD.

hufman commented 3 years ago

Interesting! When I tested with the My Mini app, I did notice that the phone flipped the USB connection to Accessory mode, so the Mini app is successfully opening the accessory connection, but seemingly not launching the BCL tunnel over it. The car also doesn't indicate that the Apps connection is running. The popup you see might be because the popup seems to show for any Bluetooth connection to the car. Even if I disconnect Music and Apps, the popup still shows up. Just now in my test, I kept the phone's Bluetooth entirely disabled and didn't see the popup.

In this recent branch update, I added text to indicate that USB mode is not supported by MyBMW. I think I should go forward with this change, which should be very easy to change if the USB support changes. I do see that apkpure has a new minor MyBMW update from yesterday, so I'll wait a bit to hear confirmation on if USB support changed.

Thank you for your help in testing!