22

Why do all of my crash logs show anonymous user when all of them have a testflight account and I'm setting the uuid in the test flight initialization?

in my singleton:

#define kTestFlightTest 1

in application initialization:

[TestFlight takeOff:kTestFlightToken];
#ifdef kTestFlightTest
    [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]];
#endif
Chris McKnight
  • 8,540
  • 4
  • 29
  • 31
  • 1
    I'm having similar problems. This worked fine before. – Joris Weimar Jun 11 '12 at 17:22
  • 1
    It hasn't worked for me at all in SDK 1.0 – Chris McKnight Jun 12 '12 at 22:37
  • I'm having the same problem. It's talked about in the SDK documentation user "Beta Testing and Release Differentiation" fount here: https://testflightapp.com/sdk/doc/1.0/ But they say what you've done (and I've done), yet still no joy. :-( All to do with Apple's changes to how you can use the UDID. Good overall but annoying in this case it seems. – Baza207 Jun 13 '12 at 21:56

3 Answers3

57

Just emailed TestFlight about it and got a response with a solution that works a charm. The UDID code:

[TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]];

needs to go before:

[TestFlight takeOff:kTestFlightToken];

Swap those around and it all works fine. :-D

I've emailed back saying thanks but that it should be something they really mention in the docs (being so simple, yet not that obvious).

Edit: This answer only appliers to iOS versions BEFORE iOS 7. As it's been noted in the comments, iOS 7 removes [[UIDevice currentDevice] uniqueIdentifier] completely. There are ways of making a UUID with NSUUID from iOS 6, though I don't believe these work with TestFlight yet as they are created by the users device per app and there is no way of knowing what it'd be externally. I'm sure they guys and gals over at TestFlight are looking into a way to track who the user is, but until then, get used to seeing "Anonymous User".

Baza207
  • 2,123
  • 1
  • 22
  • 40
  • If this is working for everyone and is correct, please tick as correct answer. :-D – Baza207 Jun 18 '12 at 18:17
  • I have been trying to test it but testflight isn't updating usage data for some reason – Chris McKnight Jun 18 '12 at 22:31
  • 1
    Haha! Fair enough. Worlds of fun these computer device things. – Baza207 Jun 20 '12 at 09:57
  • I received the same response a few months ago, and that solved the issue for me. – James Skidmore Jun 27 '12 at 19:53
  • 3
    `uniqueIdentifier` seems to be deprecated. How is this implemented now? – mnort9 Jun 29 '12 at 18:47
  • @mnort9 I just checked and it say deprecated in the docs, but it still works for me. :) – Baza207 Jun 30 '12 at 12:51
  • 1
    On the depreciation of UDIDs: http://www.pocketgamer.biz/r/PG.Biz/iOS+5.0/news.asp?c=37961 For TestFlight specifically: http://blog.testflightapp.com/post/19957620625/testflight-sdk-udid-access And an alternative: https://github.com/ylechelle/OpenUDID/ (not personally tested in a released product however) – Danny Parker Jul 13 '12 at 13:15
  • As the uniqueIdentifier will be used only for TestFlight testing I think it doesn't matter to use it and makes it more accurate after reinstalling, etc. – Rivera Jul 20 '12 at 07:41
  • Yeah I have already replaced UDID calls in my app with OpenUDID. I'm not sure how this will play out though since Apple uses them for the Provisioning portal as well. – Chris McKnight Jul 25 '12 at 19:01
  • I edited this answer because TestFlight recently updated their Web Application to show Last Victim and such within crashes – Chris McKnight Jul 25 '12 at 19:02
  • Its worth noting that where once deprecated, this is now *removed* in iOS 7 – sbook Jun 11 '13 at 16:13
  • @sbook Really? Thanks, that's worth noting and I'm sure the guys at TestFlight will bring in a change for that. Though I'd warn about talking about Apple stuff still in Beta as you are bound by a NDA or similar (even though this is a small thing). – Baza207 Jun 11 '13 at 19:58
  • [[UIDevice currentDevice] uniqueIdentifier] -> removed in iOS7 – Peter Lapisu Nov 08 '13 at 10:20
  • Yeah, [[UIDevice currentDevice] uniqueIdentifier] is now totally removed in iOS 7. I've edited my answer with some more information. @PeterLapisu – Baza207 Nov 08 '13 at 11:06
3

I Have also added same in my code like

[TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]];

before takeoff, but in ios 5 this method is deprecated so i added following method

[TestFlight setDeviceIdentifier:[NSString stringWithFormat:@"%@",[[UIDevice currentDevice] identifierForVendor]]];

But still i am getting anonymous issues. i have written it to Testflight support but no luck yet. for two devices it shows user device name properly but not working on other tester's device.

Gaurav
  • 8,227
  • 4
  • 34
  • 55
  • Please, let me (and everyone else) know if TestFlight team answers your email. I'm experiencing the exact same issue - despite the seemingly correct order of `setDeviceIdentifier` and `takeOff`, all reports are marked as "Anonymous User". – Neo Oct 23 '12 at 11:46
  • They respond to my email that "we are looking into this" but no proper solution has been suggested by testflight support yet. the basic problem is testflight SDK is not sending user UDID while starting session. – Gaurav Oct 23 '12 at 12:47
  • I know the older sessions and crashes won't have which user it was. It seems like it randomly can't figure out which user it is though. I haven't had problems with it recently but I have noticed a few bugs. – Chris McKnight Oct 24 '12 at 22:11
  • Same for me, it seems like there was a problem on TestFlight side - maybe a server issue? Newer reports are no longer anonymous for me. – Neo Oct 25 '12 at 10:30
  • 1
    Just to add a to your iOS5 code, you can do it like that: [TestFlight setDeviceIdentifier:[UIDevice currentDevice].identifierForVendor.UUIDString]; – Mostafa Berg Nov 14 '12 at 08:51
0

I've just performed some tests. Clearly there is no proper way to get the UDID anymore as @Danny Parker mentioned in a comment above. To test this I hardcoded my UDID in the app and submitted it to TestFlight. Any checkpoints or feedback resulted as messages from me. No more anonymous checkpoints and feedback. Obviously this is useless as I need each tester's UDID to see what checkpoints they hit. I guess TestFlight will have to find a different way to associate devices to logs.

Lukas
  • 694
  • 1
  • 9
  • 24
  • 1
    UDID was deprecated in iOS 5 due to a lawsuit. Alternative solutions have been proposed such as OpenUDID. Apple is also advocating the use of CFUUIDCreate or NSUUID. The underlying principle is that you track the user instead of the device and yes this creates the problem with testflight that you don't know which device it came from. The UDID functionality should work (unless TestFlight removed it from the SDK recently) because Apple still uses UDIDs in the provisioning portal. – Chris McKnight Feb 20 '13 at 19:45