ChartBoost not Showing Interstitial - iphone

I have followed example from Chartboost i iOS. Even I have checkout all the Questions from Stackoverflow too. I have used their suggestions too, but not found Interstitials.
Even I have allow publish in network in Chartboost dashboard.
It works fine for the Firsttime when App is Installed on device and even if we delete the app and run xcode still the same issue that Chartboost not showing Interstitial. Every time it calls method as follows:
- (void)didFailToLoadInterstitial:(NSString *)location
I have also included below method:
- (void)didDismissInterstitial:(NSString *)location {
NSLog(#"chartboost*** dismissed interstitial at location %#", location);
[[Chartboost sharedChartboost] cacheInterstitial:location];
}
I haven't seen the Chartboost Ad in my App. I have also included the Method as follow to check whether Caching is available or not.
BOOL isCached = [[Chartboost sharedChartboost] hasCachedInterstitial:#"After level 1"];
and returns NO. In two screens I need Advertisement from chartboost. And I have given them two different Location Names too and calls them whenever needed.
How to overcome from this issue??

It's been 2 years so you already know the solution to your questions but for those who face this issue, you have to wait a few minutes sometimes even over 10 minutes for the 1st interstitial chartboost to show up whether live or test ad. When you delete your app and re-run it again on Xcode you have to wait again a long time. Sometimes longer than 10 minutes.

Related

How to check if Chartboost interstitial is loaded?

For somehow I don't get Chartboost interstitial loaded every time, asked them and as most answers:"no more of the interstitials available at the time you're testing in the network satisfy the conditions......". So now I use revmob also. The question I have: how to check if Chartboost is preloaded? my code so far:
if(Chartboost.hasInterstitial(CBLocation.Default))
{
Chartboost.showInterstitial(CBLocation.Default);
}else {
revmob.ShowFullscreen();
}
I only receive revmob interstitials. Is my checking condition ok? Saw something about delegates but I am not sure how to use them.
Yes you checking condition is OK.
For using delegates read this Chartboost Documentation on delegates in Unity3D. I think it has a pretty good explanation on how to implement delegate methods. Also I will HIGHLY recommend that you do implement these delegate methods as they will help you not only with displaying ad status logs but also identifying problems regarding Ad display.
EDIT for future reference:
For example:
Implementing Chartboost.didCacheInterstitial and Chartboost.didFailToLoadInterstitial delegates will tell you if and when an interstitial ad was loaded or failed. The fail delegate(s) also sends an error as parameter so you would know why the cache was failed.
If the delegates are not being called then there is an issue with your chartboost SDK integration in your project inside unity. In that case try re-importing the chartboost sdk and check you chartboost dashboard for issues. One of the most common issues >> make sure that there is an active ad campaign linked to your in chartboost dashboard. To setup an ad campaign follow: Start a Publishing Campaign

iOS 6 breaks GeoLocation in webapps (apple-mobile-web-app-capable)

I have an app that does a simple textbook navigator.geoLocation.watchPosition(...) that works great in iOS 5.x both in Safari and as a web app (using apple-mobile-web-app-capable meta tag).
However, in iOS6, GeoLocation does not work in the webapp. It still works in safari as expected, but when I run the webapp, it prompts me for location permission, then silently fails. I see the location icon, but no events are thrown from watchLocation. I get no error events or any location events.
Has anyone run into this? Any workarounds? It's definitely iOS6 specific and also specific to the apple-mobile-web-app-capable/webapp.
This is definitely a bug but I found a work around. You aren't going to like this but at least it will get your web app working again. You need to examine the User Agent header and if it contains "iPhone OS 6" then do not use:
<meta content="yes" name="apple-mobile-web-app-capable" />
Yes, this means that it won't be a true web app and you will get the Safari header and footer bars. But at least it will make your app work again from the home screen. You can see how this works by going to my site www.nextbus.com.
Note that it appears that Google ran into this problem. Try going to maps.google.com and then adding the web app to your homescreen. The geolocation will work for it but you will indeed see the ugly Safari header and footer bars.
Please complain loudly to Apple!
The good news is: I've done it... I've figured it out. The bad news is: somebody smarter than me is going to have to tell you why this works, whereas any other variation of this solution or any of the other solutions offered don't work. This was a hard-fought victory but I'm too embarrassed to say how many hours (days) it took me to figure this out. Without further ado:
if (window.navigator.geolocation) {
var accuracyThreshold = 100,
timeout = 10 * 1000,
watchID = navigator.geolocation.watchPosition(function(position) {
$('#latitude').val(position.coords.latitude); // set your latitude value here
$('#longitude').val(position.coords.longitude); // set your longitude value here
// if the returned distance accuracy is less than your pre-defined accuracy threshold,
// then clear the timeout below and also clear the watchPosition to prevent it from running continuously
position.coords.accuracy < accuracyThreshold && (clearTimeout(delayClear), navigator.geolocation.clearWatch(watchID))
}, function(error) {
// if it fails to get the return object (position), clear the timeout
// and cancel the watchPosition() to prevent it from running continuously
clearTimeout(delayClear);
navigator.geolocation.clearWatch(watchID);
// make the error message more human-readable friendly
var errMsg;
switch (error.code) {
case '0':
errMsg = 'Unknown Error';
break;
case '1':
errMsg = 'Location permission denied by user.';
break;
case '2':
errMsg = 'Position is not available';
break;
case '3':
errMsg = 'Request timeout';
break;
}
}, {
enableHighAccuracy: true,
timeout: timeout,
maximumAge: 0
}),
delayClear = setTimeout(function() {
navigator.geolocation.clearWatch(watchID);
}, timeout + 1E3); // make this setTimeout delay one second longer than your watchPosition() timeout
}
else {
throw new Error("Geolocation is not supported.");
}
Note: for some reason, this doesn't seem to work as consistently if the execution of this code it delayed at some point after initially launching the app. So, this is the FIRST thing I execute in my initialization method.
Note: The only other thing I've added to my app is, when I need to use the geolocation data (which, for me, takes place after the initialization of several other Classes/Object Literals), is to check for the latitude/longitude values. If they exist, continue; If not, run the above geolocation method again, then continue.
Note: One of the things that threw me for a long time was that I only needed to get the current position of the user. I didn't need to track the users' movements. I kept trying different iterations of this with the getCurrentPosition() method. For whatever reason, it doesn't work. So, this is the solution I came up with. Run it like you're going to track the users location (to get their location in the first place), then once you've gotten their location, clear the watchPosition ID to prevent it from tracking them. If you need to track their location as it changes over time, you can of course... not clear the watchPosition ID.
HTH. From everything I've been reading, there are a lot of developers who need this functionality to work for their mission-critical apps. If this solution doesn't work for you, I'm not sure what other direction I can give. Having said that, I've tested this several hundred times and this successfully retrieves the users' location in a WebApp (navigator.standalone) on iOS 6.
here is a video of me replicating the bug and demonstrating a work around. This bug appears to exist weather you use the web app meta tag or not.
http://youtu.be/ygprgHh6LxA
Update: 121212 - IOS 6.1 Beta 3 testing shows the bug is still not resolved...
Update: 122012 - IOS 6.1 Beta 4 testing shows the bug is still not resolved...
Update: 031113 - Replication Example
Okay, it is a simple issue to replicate in just a few seconds. I feel it is not a safari, but an IOS issue. It’s almost as if Google wrote the bios for the IOS to meet the WC3 html geo location spec and took it with them when IOS6 kicked them off the bus.
Using an IOS device go here:
http://uc.myaesc.com/geoloctestorig.htm
Click start, watch should return result almost every second.
Then click the Google link to leave this page.
Then user browser back button to return
Click start.
Watch will return 1 to 3 records and hang.
Minimize safari (home button) and then restore (safari icon); stops hanging
That's it. until it does not hang, the issue remains.
Mark
UPDATE:
IOS 7.1 fixed the issue...
It appears it only works once, then any secondary calls fail. One alternative is to cache the result and use the cached result if you have one, though this means you can't have an app that follows someone's position.
This is not exactly an answer as it seems like Home Screen apps in ios6 has some bug related to GeoLocation, but I found the following link very helpful. It explains that as Home Screen apps are now stored like native apps, they have their own storage/caching.
Geolocation works on the first iteration but fails to update from then on. the work around is to remove the following meta tag so that Home Screens app run in Browser mode (I am not sure if it is exactly call a Browser mode). The app will unfortunately render with the browser headers and footers, but GeoLocationwill be working again.
<meta content="yes" name="apple-mobile-web-app-capable" />
iOS 6 Geolocation and Local Data Storage
"Data in Home Screen apps are now stored like native apps. Native apps each have their own sandbox where their data is stored, backed up and restored to. Prior to iOS 6, Home Screen apps shared data with the same app running in the browser. If the user cleared the cache in the browser, the Home Screen version of the app would lose its data too.With iOS 6, Home Screen apps’ data gets saved to a sandbox just like native apps. Backups and restores handle the data properly, and clear cache in the browser will not affect them."
I'm having the same problem. Looks like watchPosition is simply failing out after the first position is received. I haven't found a work around yet, but I wanted to confirm that I was experiencing issues.
Using these samples:
http://www.w3schools.com/html/html5_geolocation.asp
I get expected results on ios5 but ios6 drops the ball with watchPosition.
I can confirm I get the same problem when running my web app in fullscreen.
Interestingly, when Safari in Fullscreen asked permission to use my location, the website title was 'web' rather than the title of the website, as in previous versions of iOS.
Removing the "apple-mobile-web-app-capable" meta tag is fine, and it works, but only if you "Add to Homescreen" again. We have ~7000 daily users who have already added our icon to their homescreen. Getting them to do so again, then potentially again when a fix is implimented isn't great.
This appears to be fixed under iOS 6.1! It wasn't in the recent betas, but today's final 6.1 release seems to be good with my testing.
seems to be fixed in iOS 6.1, finally! See my site www.slople.com where it works again under 6.1
This is FINALLY fixed in iOS7 beta (beta 2 is all I've tested)!
You must take care of non secure content loaded. For me loading all javascript, images and css from secure context solved the problem with safari.

MKStoreKit Buy Feature does nothing

I'm trying to get the MKStoreKit working with my Cocos2D game. It look pretty simple to do and I've followed all the steps a couple of times (to check I've done it correctly) but I still can't get it to work. I can retrieve a product name, price and description etc. but I can use the shared MKStoreKitManager to make a purchase.
Here's my code for buying a product:
if([MKStoreManager isFeaturePurchased: #"com.testing.iap.removeAds"]) {
NSLog(#"No ads");
}else{
NSLog(#"Ads");
NSLog(#"Buying feature...");
[[MKStoreManager sharedManager] buyFeature: #"com.testing.iap.removeAds"
onComplete:^(NSString* purchasedFeature)
{
NSLog(#"Purchased: %#", purchasedFeature);
// provide your product to the user here.
// if it's a subscription, allow user to use now.
// remembering this purchase is taken care of by MKStoreKit.
}
onCancelled:^
{
NSLog(#"Something went wrong");
// User cancels the transaction, you can log this using any analytics software like Flurry.
}];
}
Basically if the product hasn't been previously purchased, kick off the purchase process. The problem is nothing happens! I don't even get the onCancelled being called and there are no error messages apart from the one's I can ignore (i.e. iCloud support and custom server options).
Can anyone shed some light on what it is thats stopping me?
Note: I'm testing on an iPhone 4 device running iOS 5.1
As soon as your app launches, call:
[MKStoreManager sharedManager];
That's it. As long as you call the -buyFeature: method after the products have been downloaded (you could observe kProductFetchedNotification if you want) everything works as expected.
I have no idea what wasn't working but after spending al most a full working day trying to get this to work I decided to start a new project from scratch and try again. I done everything exactly the same and it all worked!
Make sure you added your IAP key to the MKStoreKitConfigs.plist. Without that it does nothing.
Also it can take a few hours until a register IAP becomes available for testing.

the game is not recognized by game center

Hi
I am trying to add game center to my iphone app.
I have done the following steps
1) I have added an app to my itnuesAccount
2) I assigned the Bundle ID as net.myCompany.myGameCenter
3) I am using the same "net.myCompany.myGameCenter" as Bundle identifier in my info.plist
4) using the sample code provided by apple i added the authentication steps.
self.currentLeaderBoard= kEasyLeaderboardID;
self.currentScore= 0;
[super viewDidLoad];
if([GameCenterManager isGameCenterAvailable])
{
self.gameCenterManager= [[[GameCenterManager alloc] init] autorelease];
[self.gameCenterManager setDelegate: self];
[self.gameCenterManager authenticateLocalUser];
[self updateCurrentScore];
}
else
{
[self showAlertWithTitle: #"Game Center Support Required!"
message: #"The current device does not support Game Center, which this sample requires."];
}
I have tried putting the kEasyLeaderboardID value equal to the one that i placed myself upon creating the new leader board.
I tried the other one, that i defined at step2. "myComap"
Other people who are stuck with this problem to this date, like me..
Turned out because my devices were jailbroken =/ .. I read an answer somewhere on stackoverflow.com that jailbroken devices interpret the app as a "real-world" app, thus not discovering sandbox accounts ..
I restored my iPad, and got an iPod touch from a friend, and both worked painlessly .. (previously, I tried it on 3 jailbroken devices, for which none of them worked ..).
Ah my bad
the BundleId at the iTunes connect and the one in the info.plist have to be same
and the leaderboardID is used for for submitting and viewing the score.
Many reasons are there for this problem
Add your app on itunesconnect.apple.com
Fill all information (Make Sure your available/publish date)
Can enter dummy data, but bundle id and name must be original as your real game.(Can't change)
then put your leaderboard/Achivement id in your app.
If still you getting same message "Game Center is not recognized this game", check your availability date which you have enter while filling the information of your app on itunesconnect.apple.com. This date should not be after your current date.
If again you are getting same problem then upload this app on AppStore. (After checking you can reject this uploaded binary)
Well, I tried every tips but still got this warning!!
Finally, I solved it by creating a new App on iTunes Connect!! After you've added a new App for your project, you need to press "Manage Game Center" and choose a group. Then your game will be recognized by the game center, even you haven't added 'Leaderboards' or 'Achievements'.
Gah! This was driving me crazy. I had done everything right, had all the correct bundleIDs, certificates, etc., my app is already in the app store, but I was still getting this message. (iOS9.x, XCode 7.1)
Turns out that adding a single achievement in iTunesConnect made things work. I suspect I could have added a leaderboard, instead.
Basically, the message can also mean "while your app says it's Game Center capable, it doesn't actually have any GC content" and adding an achievement or leaderboard makes the game "recognized" by GC.
Seems on iOS 8 GameCenter sandbox is disabled by default. I met a similar problem and solved by enabling Game Center sandbox in Settings and re-logining.

iAd error "Ad inventory unavailable" (Apple Sample code also not working)

I tried to include an ADBannerView into my application. But the ADBannerView always ends up in bannerView:didFailToReceiveAdWithError:. I'm not able to see any test ad.
I've also downloaded the iAd Sample Code from Apples DevCenter but I end up with the same error.
11/5/10 5:46:33 PM BasicAdBanner[12072] {
ADInternalErrorCode = 3;
NSLocalizedFailureReason = "Ad inventory unavailable";
}
Can someone please explain to me how I can get iAd to work in the Simulator and on my testing device?
No, I believe it was generated by Apple's server so that developers can make correction for the error.
Here is the reference from Apple.
Same here, using sdk 4.1 and unable to launch any iAd test app for the past couple of days.
I tried many things but nothing worked. Guess it's wrong on Apple side this time.
I had this problem too - an iPad would serve test iAds fine, but an iPhone would not. After a bit of investigation it seems to be related to the clock settings on the device, which sounds implausible I know! The automatic time on the iPhone was a few minutes slow, and the iPad a few minutes fast, as compared with the real time (as determined from the automatic time setting on the Mac).
Manually setting the time on the iPhone caused test iAds to start working - but only if the clock was correct to within a few seconds. So make sure to scroll the minutes wheel and exit the time picker just as the true time ticks over to the next minute. Actually it seems that it could be out by a few minutes as long as the seconds were about right, which is probably why the iPad worked ok despite being 5 minutes fast.
As to why the automatic time setting on the iPhone and iPad are so far out from the real time, that's another problem to solve. For now I'll leave my iPhone on manual time setting, at least while testing iAds.
This happened to me once - and then another time - it all worked properly. My app is released now, and works fine. So in short - maybe it a transient problem on Apple's side - or a local network problem on yours. Try again - see if it ever works. BTW - at one point I was able to get the sample iAd on my simulator but nothing on the iPhone - I released it anyway and never hand an issue.
I was testing out the iAdInterstialSuite sample project from Apple's developer site and I encountered this same error message on my iPhone 6 Plus.
I discovered how to fix it in this instance though. Apparently since that sample project hasn't been updated for the iPhone 6 / 6 Plus screen sizes, it fails because of the subsequent screen scaling the device is doing to the app. (I'm guessing the ad server knows the type of device is requesting the ad, and thus would expect the target view dimensions to be a very specific size.)
When I set a launch screen XIB for the project, so the app was then rendered at the proper scale on the screen, the test ads started working straight away. :)