AdMob: enable test ads for all devices - cocoa-touch

You have to specify each device for test ads:
request.testDevices = [NSArray arrayWithObjects:#"3222e18ddc56b034fdf816e0d93ee7a1", GAD_SIMULATOR_ID, nil];
I want to send Ad Hoc release for someone and I want him to see test ads. Is it possible?

It's not possible in latest versions of AdMob. BOOL testing propery is deprecated and not working.

Related

Apple rejects iPhone Build for showing Test Ads on App

i Have integrate Ads Mob on my app for real or live add ,its working fine on simulator and Testing device and other client device it shoes live ads. but when this build uploaded to the apple store app connect on app store, they are got Test add on my device and reject the build, i do not find the exact scenario of reject the build due to test add, since i have integrated live ads banner id of Ads Mob, i do not find the solution app store how to find test add.
please help me if you got my query.
The first thing I would do is check where you define your adUnitID in the app.
The easiest way to do that would be to use Command + Shift + F (Find) to search your entire workspace for the string "ca-app-pub" (which I believe is the beginning of any adUnitID), and ensure that the only string being used is the Live Ad string from the AdMob website for the ad in question.
If that doesn't reveal any issues, please share the snippets of code where you define and present the ad.

Cocoa app, how to show the badge label when app isn't running?

I've noticed the Spark mail app manages to show a badge count even when the app isn't running. The app is a mac app store app so it must not be using any private APIs. Is there a way to do this? Currently I'm only able to do the following while the app is running:
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:[NSString stringWithFormat: #"%ld", 10]];
You need to make a Dock tile plugin. See the documentation for NSDockTilePlugIn for information on how to do this:
https://developer.apple.com/documentation/appkit/nsdocktileplugin
EDIT: Okay, if you want to do what Spark is doing, here it is:
Spark is using Apple Push Notifications to inform you of new e-mails that come in. For e-mail accounts other than Gmail or Outlook, this generally means they store your username and password on their server, which seems "OMG!" levels of creepy to me, but YMMV. When their server notices that you have a new e-mail, they forward the notification to you.
A description of what Spark is doing can be found here: https://blog.readdle.com/how-we-handle-your-account-information-in-spark-1b42f4acef73
If you want to implement push notifications yourself, this video shows generally how to do it, and this sample code may be helpful as well.

How to get old UDID in my new upgraded app

I am using UDID to save and retrieve data from remote DB, now apple had depreciated the UDID.
Now how can I retrieve already saved data if I update my app with new version which developed using iOS5.
You can not, unless you saved the UDID some where, like the NSUserDefaults.
Apple does not allow apps to use the [UIDevice uniqueIdentifier] method any more. If this is used in your code Apple will reject the app.
Look at this library
https://github.com/ylechelle/OpenUDID
Now we haven't access to the udid, but this class generate a random id. I don't know if you want to manage your push notification but it makes it very well!
In this case, you can not retrieve the data from db! you did not use other unique data such as email or ...?
The "uniqueIdentifier" was a method to creating UDID string, I am not sure but I think you can solve your problem by regenerating the UDID, I mean you should find the algorithm of creating UDID :O

Find out which version of app was first installed - iOS

I want to change my app from a paid version to a free with ads. However, I don't want the people that originally paid for the app to get the ads.
I was thinking I could include a new update that has extra code that sets up some UserDefaults saying the version doesn't have ads and then do the update to the free version. But that doesn't seem like a very reliable solution.
I think, it depends on minimum OS version, that your program can be run on. For iOS 5.0 and later you can try to use iCloud to store some flag about purchased version. It allows you to set this flag not only for one device, but for the user's account.
Or you can store this info in the keychain to get it later. But in this case your user will not be able to have no ADs on some other device with his(her) account.
Anyway, as far as I know, you need to create an update for your app first to write this flag anywhere. And only in some time make an update with ADs.
I will be glad to see comments if someone has another thoughts about this issue.
It seems there is no reliable method to detect whether someone paid for your app or downloaded it later when the price has been changed to free. For this reason I have decided to create two separate entries in the app store.

To check what iOS version used by my app users

I have an app published on the AppStore.
I plan to change the minimal requirement of my app to iOS 5.x because there's an issue that only exists in iOS4 and it has been fixed in iOS5.
Is there any easy way to check what iOS version used by my existed users?
I want to know the statistics so I can decide whether to change the min requirement is OK or not
Thanks!
The only way to check this would be if you had already written code to send usage statistics such as [UIDevice currentDevice].systemVersion, [UIDevice currentDevice].localizedModel, [UIDevice currentDevice].systemName, etc to yourself (a webserver/db you control) in your current App.
If it is not currently coded in your live App, then there is no way to determine this information. It may be a good idea however to program this in to your next update for future situations such as this.
You need to add code for this, such as analytics or sending back, you also need to be careful with analytics as Apple discourages sending device information, but OS should be ok. The answer is no, not without recompiling, perhaps crash reports might give you an idea, but there's nothing else you can do.
Perhaps you would care to ask how to fix the issue instead?
you might use some service like TestFlight to track what version people are using.