Closed Nizam-Accedo closed 9 years ago
Weird that it ran fine on Lollipop, but the issue is basically that MoEngage requires an activity to be started (https://github.com/segmentio/analytics-android/blob/master/analytics-integrations/moengage/src/main/java/com/segment/analytics/internal/integrations/MoEngageIntegration.java#L67) before tracking events.
Also related: http://docs.moengage.com/docs/android-coding-it-up
@nizamcs where are you calling Analytics.with(context).track()
?
Hi, The call was from Application class, immediately after the library initialization. So, I have to move the line of code to the launcher activity, leaving the initialization behind. Right? Regards, Nizam On Oct 2, 2015 11:34 PM, "Abhishek Nandi" notifications@github.com wrote:
@nizamcs https://github.com/nizamcs where are you calling Analytics.with(context).track() ?
— Reply to this email directly or view it on GitHub https://github.com/segmentio/analytics-android/issues/358#issuecomment-145106939 .
@nizamcs Yes, that would work for now.
I think we should try to handle it in the Segment integration, and defer calling MoEngage until an activity is initialized — but I'm unsure what the behaviour should be when there isn't an Activity created (e.g. say this happened in a background service). @Atrix1987 any suggestions?
@nizamcs call track in your activity. @f2prateek i'll change the implementation, to handle this. Had tied up MoEHelper to activity because it is required for InApps and some other features. But yes both can be handled. When is your next release, would send a PR before that ?
Hi,
I moved the 'Track' to the launcher activity and is working fine now. Also, waiting for the updated library, so we can use it even without an activity. Thank you.
Regards, Nizam CS
Thanks & Regards, Nizam CS
On 3 October 2015 at 10:26, Abhishek Nandi notifications@github.com wrote:
@nizamcs https://github.com/nizamcs call track in your activity. @f2prateek https://github.com/f2prateek i'll change the implementation, to handle this. Had tied up MoEHelper to activity because it is required for InApps and some other features. But yes both can be handled. When is your next release, would send a PR before that ?
— Reply to this email directly or view it on GitHub https://github.com/segmentio/analytics-android/issues/358#issuecomment-145200580 .
@Atrix1987 anytime is fine, we've already made 2 releases since this issue was opened
Integrated library though gradle : com.segment.analytics.android:analytics-integration-moengage:3.2.1+
In my Android Application class, I have this
This works fine in Lollipop, but got crash in Kitkat(4.4.4) The crash log is as follows: