bitstadium / HockeyKit

HockeyApp was retired and the SDKs are deprecated. Please use App Center instead.
http://appcenter.ms
MIT License
2.17k stars 444 forks source link

Stats #163

Closed blubyu closed 4 years ago

blubyu commented 11 years ago

I have the server up and working fine. I can add apps to it and install them on my device. What I can't get to work is the stats. I can open the stats webpage and it lists the apps that I have but there is no information for that apps. I thought I needed to have the client portion installed in my apps but after some reading it seems that is not the case. It appears I should be able to get some minimal stats without the client portion.

I have checked my apache logs and I have fixed the permission problem with logger.php. Other then that I am at a lost. Can anybody point me in the right direction?

FabianFrank commented 11 years ago

You need to have the client SDK installed and call it correctly inside your app, to get the stats. If the app makes no update checks the installation won't show up in the stats.

blubyu commented 11 years ago

Thanks for getting back to me. I tried to follow the doc on how to add the ios client to my app but I couldn't make it work. Is there a more recent doc somewhere or more recent version of the ios client that I can use?

FabianFrank commented 11 years ago

If you have still problems after following https://github.com/TheRealKerni/HockeyKit/wiki/iOS-Client I am happy to try and help. If so, please share the relevant part of your code in a gist (or similar mechanism). Thank you.

blubyu commented 11 years ago

I tried this method :

"Download the sources and drag’n’drop all files from /client/iOS/ (except Beta Automatisation and HockeyLib folders) into your project. If you already use one of the required 3rd party frameworks (JSONKit or SBJson) in your project, exclude these from the Hockey client."

When I try and build my app I get a ton of ARC related problems. I am very new to ios programming and I am using the latest beta Xcode and ios 7. Don't know if that matters but I thought I would let you know.

Should I try the static library method or will I run into the same type of errors?

DerAndereAndi commented 11 years ago
  1. You have to exclude the files from ARC. Here is a hint on how to do that: http://stackoverflow.com/a/8040712/474794
  2. The stats won't work with iOS 7, since the UDID is not accessible via the API. Also restricting updates to specific devices will not work therefor either.
FabianFrank commented 11 years ago

As you can see, the HockeyKit code (e.g. https://github.com/TheRealKerni/HockeyKit/blob/develop/client/iOS/BWHockeyManager.m) does not use ARC, but does manual reference counting. Since in your project ARC is enabled (that's the XCode default and what you should do today) the build fails. There are two ways to solve this. You can disable ARC on a per-file basis in XCode's project settings under Build Phases->Compile Sources. A detailed description is at the end of http://beageek.biz/how-to-disable-arc-xcode-project/. The static library approach will also solve the problem, because the HockeyKit will be compiled using the settings of the HockeyKit project, which has ARC disabled.

blubyu commented 11 years ago

Thank you both for your help. When I get home tonight I will give the static library a try. That sounds like the easiest way to do it.

So since the UDID won't be available does this mean I won't have any stats at all? The only think I will get with the client portion will be the app update feature?

FabianFrank commented 11 years ago

IMHO you can implement the device ID function using the alternatives to the uniqueIdentifier recommended by Apple: https://developer.apple.com/library/ios/documentation/uikit/reference/UIDevice_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/occ/instp/UIDevice/uniqueIdentifier

@TheRealKerni correct me if I'm wrong. :smile:

DerAndereAndi commented 11 years ago

You can use any of those, but you will have no idea who this person actually is. Also there are situations where these numbers change for the same device. So in general: you won't have meaningful stats.

FabianFrank commented 11 years ago

I guess it depends on your use case, for example in my world I am not allowed to uniquely identify a person anyway, meaning even if I get their identifier I only use it to know that this is a "unique device". So if you don't care about pinning the device to a real person (like I do), it won't matter and you could use identifierForVendor to detect how many "unique devices" are running your app.

DerAndereAndi commented 11 years ago

We are talking about beta testing, not distributing the app to end users ;) And HockeyKit is only meant/designed for beta testers in the first place where it is desired to know who is testing and who is not given the limited number of UDIDs you can put into a provisioning profile. Using this system with enterprise profiles is a completely different topic I'd say :)

blubyu commented 11 years ago

I get to the step where I add this code:

if !defined (CONFIGURATION_AppStore_Distribution)

[BWHockeyManager sharedHockeyManager].updateURL = @"http://your.server.com/";

endif

I have added it to my AppDelegate.m under didFinishLaunchingWithOptions: Is that not the right place to add it? I get an error when I try and build my app. If I comment out the code then I can build and run without an error.

Here are the two errors I get:

Undefined symbols for architecture armv7: "_OBJCCLASS$_BWHockeyManager", referenced from: objc-class-ref in FMPAppDelegate.o ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

mludi commented 10 years ago

Hi blubyu, did you import libHockeyLib.a in your "Link Binary With Libraries"?