[iOS 2.0] Switch to another hub does not ask for device

From welcome screen, tapped hub name then switch to another hub. It asks me to select the hub but then does not ask which device to associate with. On my main hub there are two mobile device so it for sure should be asking which one. Not sure how it is deciding, but it is attaching to a device.

3 Likes

This is still an issue in build 239.

@moncho1138 I deleted the app and reinstalled it due to crashing, much to my surprise it still only asked for a hub and then automatically selected a device to attach to. It was the correct one but not sure how it is deciding? This was on build 239.

A new feature on this app is that the deviceId will persist even after uninstall so it picks the right one everytime without creating duplicates.

1 Like

I think that is good for people who may switch the app between hubs, less chance for mistakes.

But, what if the wrong one gets selected and I want to change it to a different one?

For example on my C7 hub I only have one mobile device. The new app on my phone has attached itself to the device that was created for my Android tablet (to use smart start). Not sure if I picked that at some point or what, but now I have no way to change it unless I delete that device from HE. Which if I have a bunch of notifications tied to it, that would be very annoying.

What actually happens with presence if you have the app on two difference devices pointed to the same virtual device on HE?

In the case of presence, the last phone to select a mobile device is the one that will send a presence change to the hub.

Although this seems like a great idea, this does not work right now (at least for me).

I think that this is the reason...

  • installed beta app
  • registered on hub and device with beta app
  • opened the v1 app after having multiple crashes from beta app
  • logged out of v1 app after a new version was out
  • now using beta app but not receiving any notifications and geofence is not working, so I'm connected to the hub but not the device if that makes sense?

Did not try logging back in the v1 app yet, want to see what @moncho1138 might suggest first.

I also went without notifications for a while, until I went into the mobile device page and pushed one directly from there, while the beta app was open. Notifications magically reappeared - or was it a coincidence?

Tried that but did not work for me with the latest version.

Just tried it again just in case, but no go :frowning:

So I tried logging out of Beta app, logging in v1 app, sent message from hub and received it as expected.

Logged out of v1 app, logged in Beta app, sent message from hub but did not receive anything.

I'm under the impression that it's not connecting to the device for some reason, did not see anything in the device logs nor in the events about app connecting to the device (might be a nice idea to add this to the driver ?), only logs or events are "message sent message to iPhone Nelson".

If you want me to test anything else, let me know.

@moncho1138 This is still an issue in 252

Is there any plans to address this or will you just be stuck attached to the same device on the hub if you select the wrong one on accident or need to change it for some reason?

There could be a separate option to switch the device. This way if people are switching hubs it will be smooth without asking for the device (using the last one attached however it does that currently), but if you really need to change to a different device there is a separate way to do that.

Same issue here also, maybe at least have a link to switch device somewhere?

I noticed on build 253 this seems to be happening at random where it asks what device. I have been switching between 3 different hubs on the app testing some things with the platform beta. It is not every time though so it is remembering the device some times and then other times it asks me to select it. Not sure if there is some logic to this or just a random bug.

What was the final fix for this? Should it be asking for the device every time now like it did in the past? Last I checked sometimes it did and sometimes not but I dont think I have tested it on 257 yet.

Ok, after some PMs with staff I have uncovered the secrets for this.

For the iOS app it us using the DNI to keep track of which device entry (on the hub) the app is linked to. Not sure how my mobile devices got created exactly but they both had a different DNI on my two hubs. This caused the 2.x mobile app to ask for a device selection every time I switched hubs. The app does not "fix" the DNI, it leaves it as-is.

I found if I edit the DNI to be the same on both that it then will switch between hubs without asking for a device. It seems that if the DNI on the hub you left, is the same as the hub you change to, it will pick the device for you automatically. The DNI appears to be a randomly generated UUID.

So now I wondered if I trick the app into letting me create a new device will it create a new random UUID (for the DNI) every time or is it actually unique to the device somehow. So by renaming the DNI on my test hub I got the app to let me create a new device on that hub when switching to it. It created a new device with a new DNI. Switch back and forth once more and it asks for the device again as expected (because man hub DNI does not match). Again I create a new device, surprisingly it actually linked back to the same new device from the last test and just renamed it. So the DNI seems to be unique at least for the app installation. Even if the app gets confused and someone tries to make a new device entry the app will link to the old one (if created by this app).

Next test will be deleting the app.


Pleasantly surprised that even after deleting the app and reinstalling it, the app linked back to the same device. I selected my test hub that has the device with the 2.x app created DNI on it and it linked right up to it without asking for the device. So somehow this DNI it created is linked to either my hardware or my user account, either way it seems to work well.

2 Likes

Solution:
Further testing has revealed that the DNI is random and must be tracked in the cloud system somewhere. All that seems to matter is that you have the same DNI set on all hubs, if yours do not match just pick one and copy it to the mobile device entry (for the hardware device in question) on all your hubs.

Once the DNI matches across all hubs when you switch hubs it will select the correct device for you, making it much easier to switch back and forth if you use multiple hubs.

If you use multiple devices I would suggest a separate "Mobile Device" entry on each hub for the other device, with its own DNI, which also matches across all the hubs you use it on.

1 Like

Is linked to hardware and the last hardware using the driver takes precedence. You can also use "Mark in Use" to make a note to yourself which mobile device (hardware) is using a particular mobile device (driver):

1000008627

Dos the Mark in Use carry over to the app anywhere you can see it?
I always just set the name/label to something more useful and that has always shown in the app.

image

Possibly in the future, but for now, is just an informational note for yourself.

This is one of the most useful posts I have seen in some time. Thank you Jeff.

1 Like