Google analytics IOS - Several trackevents between two dispatch - iphone

I have a little problem with the google analytics API on IOS.
When I try to track two events, or two page views, between two dispatches (called automatically with the dispatchedPeriod), the second event is never fired.
When I set the debug flag to YES, it shows that the dispatcher is busy...
Moreover, if I try to restart the app, every new event will be added on the event stack but never called neither.
Everything is working fine if I call the dispatch methods of the shared GANTracker just after the tracking calls, but with this solution, the dispatchedPeriod just become useless...
Anyone has encountered the same issue ?
Thanks !
EDIT : it seems to work with 3G connection but not with WIFI

The problem is solved !
It was a network configuration problem.
Thanks !

Related

Problem using signalr for chat application flutter

I had made a whole chat application using signalr as a socket with the online and offline facility. I am facing a few problems,
Signalr connection is always time out after some time, to overcome that I had condition if hubconnection is not connected then create new hubconnection (onResume app), but still it get hubconnection._callback got increased when sending message and not moving to server side socket. Again need to refresh whole app.
Can someone tell me whether this is problem because there are lot of operations going on and so signalr loses its connection as flutter is single thread and it cannot handle much? or should I use Isolate or inherit widget.
Summary problem:
I cannot send message in chat after sometime. It stores all message in hubconnection._callback and not going for server.
Is anything better solution to keep alive in both Android+iOS.
I had used https://pub.dev/packages/signalr_netcore package.
Please do not mention about firebase.
Any other logic suggestion is appreciable.
Thank you.
I've been using a different package, https://pub.dev/packages/signalr_core, which works fine without any particular issues what I have observed at the moment.
I'm only running about 10 listeners simultaneously, not sure if that is more or less than you. In the package I'm running you can establish connection with automatic reconnect. It looks like this:
HubConnectionBuilder().withAutomaticReconnect().withUrl(....)
It seems like your package have the same functionality... Have you tried that?

Realm - RJSRealmDelegate.changes_available assert(0) causing crash

We are building a React-Native iOS app that needs to access our realms natively as well as via RN.
We have writing working correctly from our UI and can load the data in our background Swift service, but after the write, The changes_available method in js_realm.cpp is firing which contains assert(0) which is causing the app to crash/hang in debug. What do we need to be doing to prevent that method from firing?
Update: A release was just made (0.11.1) which should prevent this crash from occurring. Note that notifications across bindings have not yet been tested and may not work.
This method gets called when changes are made externally to a Realm from another process or thread. In your case it sounds like writes made from the swift apis are causing this method to get called. The ReactNative binding was written with the assumption that everything would be done from a single thread without considering the use of other language bindings being used simultaneously.
As is the only thing you can to do prevent this is to not make a write in Swift while a Realm is open in JS. One way to do this would be to call Realm.close after every use, although this may perform poorly.
In the near term we can also do a point release to remove the assert(0) - this will prevent the crash/hang, but notifications for changes made in Swift wont work without additional changes. Can't give an estimate of when we can get cross language notifications working properly.

In app Billing V3 onActivityResult isn't called

I've implemented the new IAB in my application, but when I tested it on two different device the result were different on galaxy S3 the flow was great but on galaxy S1 (gt-i9000), after purchasing onActivityResult method isn't called and the application restarts.
any suggestions?
I had the same problem, in my case the reason was that I had a flag set in the intent that called the activity which hosted the purchase process
i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
after removing the flag it works, I guess it is because when the startIntentSenderForResult starts the purchase interface the activity is destroyed, not kept in history and somehow there is no point to handle the onActivityResult
Are you using TABActivity? If answrer is yes than procedure is somewhat different,As the
onActvityResult will be called for the parent class which is your activity that extends TABActivity,I dont know why but it seems that parent is cathcing the onActivityResult.So your code for startActvityForResult or startIntentSenderForResult should be in that actvity.
i used this link and made some changes according to my app and it works
onActivityResult is never called in TabActivity
My gremlin for this problem was using a negative requestCode. That breaks the result dispatching mechanism.

iOS: does google analytics SDK caches all data for sending them later if no internet is available?

Does google analytics SDK caches all data for sending them later if no Wifi is available? I guess everything is OK when iPhone/iPad is online (has internet available) then it sends all events data. But what about its functionality when the device has no internet connection? Do I have manually to check for internet connection (for example with apple reachability class) and maintain the data cache for later use myself?
Short answer: yes.
More details:
In case you use dispatch period greater than zero (let's say 15):
every 15 seconds GA tracker will try to dispatch events, AND
if no network connection is available, tracker will try to dispatch after another 15 seconds until success, AND
if it fails and you quit the app (it's not paused in the background), on next application session, tracker will try to dispatch your events again according to dispatch period.
In case you use dispatch period is equal to -1, which means you dispatch your events manually by calling [[GANTracker sharedTracker] dispatch]:
if you call dispatch but connection is not available, event will get cached, so next dispatch call will try to send cached events in a batch,
again, events are cached between application sessions.
The above also applies to a mix of above two cases: you use dispatch period > 0, but you decide to dispatch some events manually.
Note: I have no idea how much events/data can GA tracker cache before its' buffers get overwritten or go haywire.
Some other tips for using GA:
if you're unsure about something, set option dryRun to YES and test
your scenario. Also you can use some other account ID for testing
without dry run.
use GANTrackerDelegate methods to see if hits were dispatched.
This is a related question, basically you need to use batching. I think Flurry analytics makes this aspect more transparent (you just log events and it takes care of everything).

OpenFeint achievements performance

I've decided to integrate OpenFeint into my new game to have achievements and leaderboards.
The game is dynamic and I would like user to be rewarded immediately for some successful results, but as it seems for me, OpenFeint's achievements are a bit sluggish and it shows visual notification only when it receives confirmation from the server.
Is it possible to change something in settings or hack it a little bit to show notification immediately as soon as it checks only local database if the achievement has not been unlocked it?
Not sure if this relates to the Android version of the SDK (which seems even slower), but we couldn't figure out how to make it faster. It was so unacceptably slow that we started developing our own framework that fixes most of open feint's shortcomings and then some. Check out Swarm, it might fit your needs better.
There are several things you can do to more tightly control the timing of these notifications. I'll explain one approach and you can use this as a starting point to explore further on your own. These suggestions apply specifically to iOS apps. One caveat is that these suggestions refer to internal APIs in OFSDK 2.8 for iOS and not ordinarily recommended for high level use and subject to change in future versions.
The first thing I recommend is that you build the sample app with your own product key. Use the standard sample app to experiment before applying the result to your own code.
You are going to get the snappiest response by separating the notification pop-up UI from the process of submitting the achievement. This way you don't have to worry about getting wrapped up in the logic for deciding whether the submission is going just to the local db or is doing the full confirmation on an async network transaction.
See the declaration of "showAchievementNotice" in "OFNotification.h". Performing a search in the sample app, you will see that this is the internal API used for displaying the achievement pop-up when an achievement is earned. It does not actually submit the achievement. You can call this method directly as it is called from "OFAchievementService.mm" to directly control when the message appears. You can then use the following article to disable the pop-up from being called when the actual submission occurs:
http://support.openfeint.com/dev/notification-pop-ups-in-ios/
This gives you complete freedom to call the submission at a later time provided you keep track of the need to do so. For example, you could locally serialize a flag to take care of the actual submission either after the level is done or the next time the app starts up. Don't forget that the user could quit out of a game without cleanly finishing a level.