Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service _after_ implementing AdMob - swift

I just integrated AdMob into my project and I get a whole bunch of these error messages in the Xcode output.
The app does not communicate w/ the internet and does not open up WKView (all I found n SO was references to WKWebView like this https://stackoverflow.com/a/44623268/14414215 but doesn't seem to be related to me since I don't use WKWebView). All I did was integrate Google-Mobile-Ads using cocoa pods and followed the Admob support pages.
Some SO Pages talk about ATS, but google support pages don't have the same error message (https://developers.google.com/admob/ios/app-transport-security)
App Transport Security has blocked a cleartext HTTP (http://) resource
load since it is insecure. Temporary exceptions can be configured via
your app's Info.plist file.
Its happening both on simulator and real device. Is this a real issue or something I can ignore?
Also, there's a ton of messages coming out from the Admob SDK, it's frankly a bit annoying to filter through.

The Messages in the console remains and does not seem to affect the app performance (AFAICT) and while it is excessive, I have silenced them some-what using environment variable ( https://stackoverflow.com/a/64471106/14414215) in my scheme. (per below pictures)
Take note however, if you do have issues w/ Google-Mobile-Ads, please be reminded to remove this such that you will be able to see the console messages.

Related

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

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

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).

Disabling caldav reminders in iPhone

I am writing a caldav server for our company which will be compatible with a number of clients, one of the key supported devices will be iPhone running iOS 4+.
This server will only support VEVENTs however when the server is initially configured under settings in the iPhone, the iPhone thinks that the server also supports VTODOs. As there is no VTODO calendar outlined, it then proceeds to try to create a default one on my server. The Warning in the console output reads: “This account is enabled for tasks, but has no task calendar. We’re going to create a default one” I return that MKCALENDAR request with an empty response with 403 status, however the phone doesn’t seem to realise it’s failed and still puts the Reminder list in the Reminders app. I’m not where I should be flagging to the phone that this account is not enabled for tasks.
I haven’t been able to find much information on caldav servers in general and none on what iOS supports and is expecting from a server. I have been adhering to the standards in multiple RFCs including 4791, 5545, 3744 and 4918 but have not been able to find any help for this particular issue. I have also looked through the developer resources provided by apple to no avail.
Any help or pointing in the right direction would be greatly appreciated.
Jo
We needed to support serving iCalendar events to iOS as well, and struggled with some of these issues. For our problem, the calendar was read-only to our target clients (which I'm guessing is likely not true for yours). The server task was dramatically simplified when we realized we could use the subscribed calendars option to just get a calendar feed without anything else:
Not exactly a direct answer to your problem, but hopefully useful as an option to consider.

How do I upload files using http/ftp to iphone/ipad? (Eg. ifile, goodreader)

Is there any good advice on uploading files to the device? I've seen many apps create a http server on 80 or 8080 to upload files. Does that mean I have to implement a server too?
Are there any 3rd-party libraries? (Preferably open-source and non-GPL)
EDIT: I am going to upgrade files in the app for specific devices in a corporate environment, so the ipad pulling files from a central server is also an alternative. But I would have to send messages to these ipads to tell them to fetch those files.
But I would have to send messages to
these ipads to tell them to fetch
those files.
Push Notification Programming Guide
Or mail with custom URL scheme for launching your application.
iOS Application Programming Guide - Implementing Custom URL Schemes
I assume what you want is a kind of automatic update. An app do something by order from server without user's manual operation.
I don't know enterprise-license specific feature of iOS. But I believe there's no such enterprise-specific APIs. And as I know, automatic update is almost impossible. Because,
There is no system-level support for automatic update. (yet?)
So messaging and fetching feature should be implemented in app.
But no app is guaranteed to run in background for long time.
And also user can turn off any app at any time.
There is no way to send message to an app which is not running.
Even you can send, there is no way to address each client form the server.
If your app is running, sending message or commanding them to fetch or do anything is just a simple work. The problem is there is no regular way to force them always keep alive. Even under situations like OS reboot or abnormal termination.
However there is an alternative. Just registering app as VOIP app like Skype. OS does not keep the app running too, but will monitor specific socket port, and will wake your app when the socket receives some message. For more details, see here: http://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5-SW15
In AppStore, an app using VOIP for other purpose like automatic update will not be passed, but you have no need to concern about it.
And other way to send message to device without running app is push notification. This is a feature supported in system-level. But this is not designed to commanding app. This is designed to send textual message. So If your app is not running, the message will be displayed to user. However, you can guide the user to start the app by sending push notification.
As a final option, you can request some feature to Apple for enterprise environment. If your company is big enough to get an enterprise license, Apple will consider your feature request seriously.
If you decided to use VOIP method, I'm sorry I can't help you any more. I have no experience of implementing this kind of app. But it should not so hard.
However hard part is server. It definitely require custom server program which keeps TCP/IP connection. Regular HTTP server cannot be used. Because HTTP itself is designed as not to keep TCP/IP connection. You have to build this kind of server yourself from scratch. You'll have to handle lower level TCP/IP transmissions.
There are a few solutions(both of free/commercial) for this kind of server, but none of are popular because this kind of server regularly needs full customization. So there's nothing to re-use or share.
However I believe this is most suitable implementation for your app.
If you can satisfy automatic update only when the app is running, you can archive it by polling server status from the client periodically.
This is easy to implement because you can use regular HTTP servers for this. Client connect and download recent updates from central server periodically. If there is a new update, just fetch and do what you want. And the app is launched, just check the update at first. Prevent all operation until update applied.
This is regular way. Most of applications are built with this method. In this case, you have no need to implement server or hard thing.
However applying speed of update is depend on polling period.
(Edit)
I couldn't care about private APIs. Because your app is not for AppStore, so you can use private API's freely. (This is different thing with jail-breaking. There are so many hidden features by excluded from documentation) I don't know about private APIs, but it's possible there is some API which enable the support for keep-alive of the app.
However, this reverse engineering work is so painful unless you're born to hack.
You may try to use the following open-source in your project:
http://code.google.com/p/cocoahttpserver/
https://github.com/robin/cocoa-web-resource/wiki
Apple has some sample code on their website that details exactly what you're looking for:
http://developer.apple.com/library/mac/samplecode/CocoaHTTPServer/CocoaHTTPServer.zip
So you have a couple options:
You could distribute your app wirelessly within your organization and push new content out as app updates. Apple provides this option to their Enterprise Developers.
Wireless App Distribution
iPhone enables enterprises to securely host and wirelessly distribute in-house apps to employees over Wi-Fi and 3G. Apps can be updated without requiring users to connect to their computers. In-house apps can be hosted on any web server accessible to users. Users simply tap on a URL to install apps wirelessly without needing to connect to their computers.
The alternative is you configure the app to fetch the updated data. You describe adding an HTTP server to the iOS device, but there's no way the server can receive data when the app isn't running. Given your needs, it would probably work better to embed a web client in your app instead.
If I was in your shoes (and option #1 didn't work), I'd use ASIHTTPRequest to check with a server at launch/daily. If there are new updates, the app could then either prompt the user that there are new data files to download, or it could just silently download them in a background thread.
UPDATED: Perhaps I should have been more explicit about how to do #2. You can configure the download so it isn't interrupted when the user quits the app (you don't need to do a Voip hack). Check out the Completing a Finite Length Task in the Background section in the iOS Programming Guide.
There are http server sample codes from Apple and open source community such as cocoahttpserver TouchHTTPD.
You can upload file to the http server on iphone.
Here's a blog and screen-shots about running cocoahttpserver and upload file to iphone.
The Python CGIHTTPServer allows you to create a server in 0 lines of code:
jcomeau#intrepid:~/rentacoder/bin2txt$ python -m CGIHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
Actually implementing a script to parse the input and save the file would take a little more effort.
[later]
OK, so forget about that, Apple doesn't allow it. See Local server on iPad for the iPad at least.

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 ....