Closed barfoon closed 9 years ago
+1
official support would be nice. any uses of UIApplication aren't available so it would be nice to define a means for avoiding it or just updating the read me to explicitly state the install is different.
here was the issue tracking AFNetworking changes:
@barfoon @piemonte, I will have a look into how we can do this. The main issue would appear to be with background tasks, as well as using a preprocessor #ifdef to remove all the non-relevant parts of the Mixpanel SDK such as Surveys and Notifications. It does seem possible in theory.
At the moment we're firing a call to our servers from the app extension which then will manually ping Mixpanel server-side, but would be much nicer to do natively. Looking forward to a solution, thanks!
It is actually possible to use Mixpanel inside an extension with Cocoapods presently, in case that helps anyone.
@alex-hofsteede Just wondering if there were any updates on this one?
@barfoon Sorry I haven't had the time to work on this one yet. Will update when I do.
+1 while it is possible to use Mixpanel inside of an extension, Mixpanel does not properly send events making it useless for my use case.
Note that I'm referencing a custom keyboard extension, and having added MIXPANEL_DEBUG/MIXPANEL_LOG to the preprocessor, it appears that Mixpanel falsely views its state as offline and queues / archives all events instead of reporting them. Here's a gist with verbose mixpanel output showing the issue (note that this is on a device with full connectivity).
@fisch0920 I'm seeing the exact same thing. Manually calling 'flush' seems to work for me. Does doing that have any serious downside?
@alex-hofsteede - Hello, are there any updates to this?
Looks like it's fixed in v2.8.0. https://github.com/mixpanel/mixpanel-iphone/releases/tag/v2.8.0
@iamtony @athasach yes, this is now fixed as of v2.8.0 - let us know if you run into any issues
yep use pod "Mixpanel/AppExtension"
for your app extension target in your Podfile. I'll put up some docs on the site about this.
nice :ok_hand:
This thread is outdated.
The latest solution is to use pod 'Mixpanel-swift-appex'
and can be referenced here:
https://github.com/mixpanel/mixpanel-swift/issues/75#issuecomment-289661136
If so, how? Currently there are many referenecs to [UIApplication sharedApplication], which is not accessible in application extensions.
Thanks,