Open bently93 opened 4 years ago
Hey @bently93 ,
I saw you're using idfv as userId in your code. Problem is that identifierForVendor
might return nil
the fist time you call it. Please refer to https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor.
That's also why we tried ourselves in our code while fetching idfv. https://github.com/amplitude/Amplitude-iOS/blob/master/Sources/Amplitude/AMPDeviceInfo.m#L222
The idfv is always not nil value, I have checked in colsole. The trouble is, we passed correct idfv value to Amplitude Identify, but UserID is still empty in a user profile and his event stream. Note: after passing value, we also rechecked current UserID value in Amplitude instance, and we see what passed value = current UserID in instance.
@bently93 That's in your dev environment, right? On other users' devices, this might be nil. It's not guaranteed non-nil when fetching it for the 1st time.
My question is, while you're testing it on your dev environment, are you able to see userId, assuming idfv
is not nil?
yes, I see the correct UserID in console when idfv not nil
Yep, that's the problem. One the phones of some of your users, they could get idfv nil
, which leads to this problem.
i don't get nil
but in website is empty
Could you share which company are you coming from? I might need look into your data.
Hi @bently93 - to further assist you on your inquiry, please submit a ticket to our Support team at support.amplitude.com and link this Github issue to the form. If you could also provide your org ID when filling out the form, that would be helpful as well.
Could you share which company are you coming from? I might need look into your data. @haoliu-amp, I need your email for share the chart.
@ceocraft Could you create a ticket in our help center instead and share the information with our platform team? Thanks. @bchiu146 can help you out on this.
@ceocraft Could you create a ticket in our help center instead and share the information with our platform team? Thanks. @bchiu146 can help you out on this.
Ticket ID #39026
We performed several tests and found out that if we set the deviceToken as the User ID and it matches the Device ID in Amplitude , the User ID in "User look-up" report becomes "(none)", but if we append the any character to the deviceToken, for example dataCacheRepo.deviceToken + "A", then UserID is successfully mounted.
@bently93 I see! Look like we have some logic in our backend system might lead this to be nil. We will discuss internally about what to do for this case.
@haoliu-amp Any updates on this? I think I'm having the same issue, should I try the hacky way of adding an extra character? or is something solved now in newer versions?
Hello! We had a issue with setting UserID in the iOS SDK. As UserID we use DeviceToken. For 90% of our users, UserID remained in the value "(none)", while for 10% it was successfully setted. On our test devices, UserID is also successfully setted. SDK amplitude/ 5.1.0
code example:
Amplitude.instance(withName: "first").initializeApiKey(amplitudeApiKey, userId: UIDevice.current.identifierForVendor?.uuidString ?? "")
UIDevice.current.identifierForVendor?.uuidString
always don't nil. It's checked through debugPrint.