How long time is data cached with GA plugin in Unity apps - unity3d

We have an Android app built using Unity and the Google Analytics GAv4 plugin for Unity.
The use-case is that the users might use the app for days without internet, and when they do connect to internet again our expectations is that the data is cached on the device and will then be sent off.
Our initial tests seems to work, but cannot find any reference to how long the data persists on the device, and if there are any expiration of the data. The users have experienced that they miss some data generated when offline.
I have tried exploring the plugin, but cannot seem to find anything about how it caches the data. Anyone who have experience with this?

It looks like it is using com.google.android.gms.analytics.GoogleAnalytics which you can search the documentation on. It also might depend on the highest API level/android version on their device, where low version may not be able to send while offline or something. I think this page explains a little about how it keeps checking for a connection and tries to dispatch the events:
https://developers.google.com/android/reference/com/google/android/gms/analytics/GoogleAnalytics#dispatchLocalHits()
I saw in the plugin source code here:
https://github.com/googleanalytics/google-analytics-plugin-for-unity/blob/master/source/Plugins/GoogleAnalyticsV4/GoogleAnalyticsAndroidV4.cs

Related

Unity play games services cloud save internal error

I have used the same code given by https://github.com/playgameservices/play-games-plugin-for-unity to add the cloud save game functionality, enable save games have been called at the beginning of the code and save games are enabled from the google play console as well. The leaderboards and achievements are working fine.
The OnSaveGameOpened function gets an internal error as SavedGameRequestStatus status.
I am not able to find the cause of this (internal error being received as the status), can anyone help me out please? How can I solve this.
P.S. Serialized data (in the form of bytes[]) was fed into the SaveGame function, serialized using the binary formatter.
Edit:
I was able to debug this further, I get an error on the activation of save games in the play console. I have activated the save games feature and published it (this was done a few days ago). I have also confirmed that the Drive API, Play Games Services API and Play Games Management API are enabled under the API console project. I get following error,
Cannot use snapshots without enabling the 'Saved Game' feature in Play console
log from running on an android mobile.
The answer to this question
Google Play Games :: Cannot Use Snapshots Exception
states that it will activate within 24hrs, but it is not active even after multiple days.
There are several causes of an internal error; there should be other logs indicating the root cause. You might want to take a look into the source code to know what logs to expect.
If you're testing in an emulator, make sure your play services and play games are up-to-date.
Reference:
https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidSavedGameClient.cs
The problem was solved. It was not a problem from my end, it took well over 24 hours for the saved game services to activate. The problem solved itself once the saved games were enabled by google (there was no notification that the saved games were enabled, instead the app started working properly).

Fetch from background

I am writing an iPhone app, and I have a remote server that will deliver content. I would like to have my app poll the server once per day to see if there is new content, even if it's not running or in the background. I would also like to do this without setting up an APNS. Any advice?
You can't do that, either when your 'not' running or if you are running in the background. The best you could do is to download once per day when your app is first run / pushed to the foreground.
You could use remote notifications to "prompt" the user to bring the app to the foreground so that it could download something?
With the current apple IOS guidelines, that is about the best you can do.
I read that you are trying to avoid using APNS, but I am wondering if you are trying to avoid it for the right reasons, especially when it is designed to efficiently solve the scenario you are describing. I've seen many developers seek alternative solutions to APNS simply because the technology appeared to be complex to use after looking at Apple's documentation. The online documentation does go into a lot of details, right down to the binary protocol level.
But just to be sure you know, there are open-source libraries whose only purpose is to shield you from all these technical details. Some libraries are more complex than others, but some are remarkably user-friendly. If you have not done so already, you might like to take a look at JavaPNS and other similar projects.

Connecting to the internet with flash iOS development

I was reading that certain API's are not available when making iPhone apps with flash, such as accessing the camera. Is it possible to still get information from the web and display it in the app using the flash method? The overall plan is to have it pull data from an SQL database using XML, and I was just wondering if that was possible still with flash. Thank you very much for your answers.
I heard the same thing about it not being able to connect to the internet, among many other restraints, when developing apps through Flash. It held me back for the first 3 months after Apples 'accept' of the platform.
But now after I've had some time to test things out on my own, I found out that the following is possible (so far):
Getting xml and pictures from the web (so why not SQL)
saving cookies
Saving pictures to the cameraroll.
getting geoLocation data (didn't get the google maps api to work YET tho)
And these are only the features i have tried so far (in development-phase, not submittet to Apple)
I'm surprised that no one else has answered your question by now.
Hope this helps gets you spirit up for developing apps with flash :)

mobile application analytics

HI all,
so we all know "pinch media" - the "spyware" software ;)
i'm searching for some really cool analytics softwares for my iphone application.
pinch media, is the one i know, it looks really great, but we all know, the reputation of this piece of software is very bad.
i'd like to know if i can use it, or if my app then is one of this spyware apps, for users (it isnt really, i know, but users might think it is, when i use this).
are there some alternatives? other programms, with the same good analysis?
I found admob and motally.com, but pinch media/Flurry is the best one atm.
Here is a good pdf that compares some of the main iPhone/iPod touch analytics providers
Try Google Analytics
Any analytics package which reports usage statistics back to a central server (Flurry, Google Analytics, etc.) will be considered "spyware" by some users, not just Pinch Media's offering. The really paranoid users will sniff data traffic out of your application and detect traffic from any service, no matter who provides it.
If you really care about those users who will be upset by this, give them the option to opt-out of data collection in your application's settings or when the application first starts.
If you are looking for more inside on your app, you should try heatma.ps. They let you view heatmaps for your app, and other interaction data.
Example heatmap:
I suggest you to take a look at Appsee
Appsee provides visual in-app analytics, including heatmaps, real user recording and user bahavior reprots. And you can create a free account there.
Flurry, Google Analytics, etc are central server to store the user's data.
If you want to build your private data center. you can visit this url
http://www.github.com/cobub
And the web site is: http://dev.cobub.com
to get the open source system (both server and client sides)
There are two kinds of analytics: business analytics and app performance analytics. Google Analtyics, Flurry etc are good for business analytics but app developers are mostly interested in knowing when app crashes, being able to capture app logs, impact of network speeds and carriers on performance of their apps. For app performance analytics, take a look at http://apigee.com/about/mobile-analytics . You not only get real time performance anlaytics but also ability to do some configuration changes in real time.

What is the iPhone SDK Missing?

I've been doing mobile app development for a long time (2001?), but the systems we worked with back then were dedicated mobile development environments (Symbian, J2ME, BREW). iPhone SDK is a curious hybrid of Mac OS X and Apple's take on mobile (Cocoa Touch).
But it is missing some stuff that other mobile systems have, IMO. Specifically:
Application background processing
SMS/MMS application routing (send an SMS to my application in the background)
API for accessing phone functions/call history/call interception
I realize that Apple has perfectly valid reasons for releasing the SDK the way they did. I am curious what people on SO think the SDK is missing and how would they go about fixing/adding it, were they an Engineering Product Manager at Apple.
The biggest shortcoming in my opinion is support for separating licensing from distribution.
What I mean by this is that it should be possible to download a trial version of an application and later purchase a license for that application (from an API call inside the application or from the app store). This would make it much easier to try-before-you-buy and get rid of the current duplicates of many applications with 'lite' versions.
I think lack of push notifications for apps is the big thing we're missing right now. With push, you can register your application to perform a task (like getting the most recent data from a web service) even when it's not running, at a time and frequency the OS decides is best. In an ideal world, along with the existing concept of iPhone apps loading quickly and resuming where you last left off, this solves the problem of not running in the background. I know some tasks will be more difficult or maybe impossible with this strategy, but it's still a pretty good compromise between third party applications and the iPhone's limited hardware.
Originally push was scheduled for last September, but it was removed from the beta SDK and not spoken of since then.
API's I'm personally looking for:
Apple80211 as a public API (private, current API is fine if documented)
Access to Volume buttons (semi-accessible via Celestial, private, needs new API)
Access to Calendar (private, API status unknown)
Access to Bluetooth + SPP profile (status unknown)
Access to Camera (directly, API status unknown)
Access to JavaScript runtime (directly, not through UIWebView, API status unknown)
WebKit access that's lower-level than UIWebView (private, current API is fine)
Access to Music Library (private, current API is fine)
Garbage Collection.
CoreData is missing.
You've mentioned some of the big ones - copy & paste (or in fact any way for apps to collaborate) is another huge omission.
It also seems to lack a desktop synch framework (at least if it exists I can't find it).
Language independence and especially lack of scripting is another pet peeve - objective-c is all very well but more languages to choose from would be good.
Inability to dynamically extend apps, via scripts or otherwise, is another big omission. This is partly an SDK/OS issue, partly licensing.
My list ordered by priority:
Mapping abstraction (the MapKit looks awesome), but that would require a new Google Maps TOS
Music library
Camera (photo + video) Access to more
UIViews, Apple designed some pretty nice custom ones for their apps
Better UIWebKit abstraction
The features I see missing that it should have is
Access to SMS
Direct Access to Google Maps App. You should be able have access to this so you could extend your application to use the built in features provided by Google Maps.
Access to the Bluetooth functionality of the phone.
Access to the Calendar. Why not allow access to simply post a calendar event for the user.
Access to Active Sync. It would great if we could directly access this and communicate back to the Exchange Server.
Core Image. They provide Core Animation but Core Image is missing. I hope that this is added to the API soon.
These are some of the features that my clients have access for in the past and are supprised when they are not available.
We definitely miss a Calendar API and SMS access. So many applications could leverage such APIs. The iPhone allows users to have everything in their pocket, but it's almost useless as long as developers cannot leverage this integration in their apps.
A language with proper namespaces.
A limitation that bugs me is lack of access to system features that require root or setuid. For example: opening privileged IP ports.
I'm not sure there is a good solution to this, as long as Apple's policy is to keep the device locked-down.
Allow program to set some kind of local timed event for your application to bring up an alert and launch your app if the user agrees (like any calendar app). You could do that with push notifications but there are many cases I'd hate to have to rely on a whole server infrastructure and network connectivity just to basically do some timed thing.
Some idea of what direction the user is facing. I cannot believe the GPS chip the newer iPhones use are not capable of reporting direction.
I would personally love to see
Access to the CoreTelephony Framework (Currently private). Which allows access to all the phone functions (Especially sending MMS / SMS).
Some sort of ability to run stuff in the background. While push notifications is ok for most things, but it is a bit hard to leverage CoreLocation (i.e. have the app show a notification at a certain location). Of course this would probably need an on/off button or app specific like push is.
animation view which will be reduce developer to make a cool app , of course the core business local still need consider more , but the view layer could more easy to use ....