How to display "More games" page via ChartBoost in iOS? - ios

I'm trying to integrate ChartBoost in my app and single ads are displaying OK.
This is the initial setup:
ChartBoost *cb = [ChartBoost sharedChartBoost];
cb.delegate = self;
cb.appId = CHARBOOST_APP_ID;
cb.appSignature = CHARBOOST_APP_SIGNATURE;
[cb showInterstitial];
But when I'm trying to display the "More apps" page, using the ChartBoost tutorial, I don't get the response.
-(IBAction) switchToMoreGames: (id) sender{
ChartBoost* cb = [ChartBoost sharedChartBoost];
cb.delegate = self;
[cb cacheMoreApps];
[cb showMoreApps];
}
I'd be very appreciative for any kind of help I can get, thanks in advance!

Since there were many requests for me to answer my own question rather than update it, I have created this answer.
To add "More apps" page you have to go to "Edit your app", then click "More apps page" tab and type the name of your campaign in the input field of the iPhone, which is showing on the right.

Related

ios11 game center find player fails

I am developing a multi player game. I want to use "standard" GKMatchmakerViewController for finding players like this:
let matchrequest = GKMatchRequest()
matchrequest.minPlayers = 2
matchrequest.maxPlayers = 2
matchrequest.defaultNumberOfPlayers = 2
matchrequest.inviteMessage = "Hello, do you want to play with me ?"
let mmVC = GKMatchmakerViewController(matchRequest: matchrequest)
mmVC?.matchmakerDelegate = self
self.present(mmVC!, animated: true)
If I invoke the GKMatchmakerViewController on both devices and press "Play now" they find each other and everything ist fine.
However when I press "Invite Friends", press the "+" on the right to add a recipient and go then to the tab "Nearby" NO players show up.
Q1: Why don't I see the player in "Nearby" but can connect to it by pressing "Play now"
Q2: If I send an invitation to my other player via iMessage the message is received on the other device and when I click it the app gets launched. But it remains at its Main Screen and doesn't take any action to respond to the invitation. What Protocol or Callback needs to be implemented in order to react to app launches caused by "game invitations" ?
Please refer to the latest API. The GC APIs have changed dramatically and most SO answers refer to the deprecated API.
Thanks
Chris
For Q2. you need to implement GKLocalPlayerListener to answer calls.
How were you able to send invites? I'm trying to figure out how to get a GKPlayer from a string. Like If I want to send an invite to my friend "Blazing420" how do I know his GKPlayer ID or how do I find him, since GKMatchRequest.recipients only takes GKPlayers as arguments.

Spotify SPTAuthViewController issues

I am having trouble authorizing Spotify. The first time I believe I logged in but it froze up on the last page of the authentication process. Now when I try to log in, the popover is a blank screen. Also when I clear my cookies, the login screen appears but won't proceed past me entering my username and password. I appreciate the help here
I have tried doing this in both objective c as per the "Simple Track Playback" demo in the sdk and in swift using this tutorial http://pachulski.me/2015/spotifyframework-with-swift/
I was running into the same issue (blank popover). This was fixed when I added "App Transport Security Settings" (type: Dictionary) into the info.plist, and then implementing "Allow Arbitrary Loads" (Type: BOOL) and setting it to "YES".
Please refer to the screenshot:
EDIT: Added code to answer Brian's question in comments:
- (IBAction)loginButtonPressed:(id)sender {
_authVC = [SPTAuthViewController authenticationViewController];
_authVC.delegate = self;
_authVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
_authVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
self.modalPresentationStyle = UIModalPresentationCurrentContext;
self.definesPresentationContext = YES;
[self presentViewController:_authVC animated:NO completion:nil];
}

Xcode - Admob banner setting with targeting and test devices

I am working on my iOS app and trying to place a banner on the bottom of the page.
First of all, I set a BOOL (BannerAd) which is initially "NO" and set to "YES" when user hits the "Submit" button. By doing this tried to avoid requesting ads eveytime the user hit "Submit". This seems to work but world be nice if you can comment on it.
My interface has a "Datepicker" where the user selects his/her Birthday. I wanted to use this information for ad targeting. Also I know my application will be used in "Germany" so I set the location manually to "Germany" since my app doesn't request location information from user. And finally I am trying to test my app on my device where I set my test device UDID in "testDevices"
My problem is, I think my requests don't work. When I enter my own "adUnitId", I get paid ads on my device (which may cause a problem). Also when I tried to change the location, for example to "France", I still get local ads. I guess my location is not working and AdMob is using the network to determine the location. Which makes me think my "Birthday" information isn't working, too.
Below is the code I use and I don't know which part is wrong. I did researched and did everything according to the guides. I am not experienced and hoped that you guys can help me out!
Appreciated!
// Show Banner Ad
if (BannerAd == NO)
{
self.bannerView.adUnitID = #"ca-app-pub-3940256099942544/2934735716"; // TEST ID
self.bannerView.rootViewController = self;
NSDate *birthday =[datepick date];
GADRequest *request = [GADRequest request];
[request setBirthday: birthday];
[request setLocationWithDescription:#"Germany"];
request.testDevices = #[ #"b23cbd41317324cd9afd14dc848f2f0e" // TEST DEVICE
];
[self.bannerView loadRequest:[GADRequest request]];
BannerAd = YES;}
I can't understand your question(s) so good. Sorry.
If you want to put your adMob banner on the bottom of the screen, just use:
bannerView = [[GADBannerView alloc] initWithFrame:CGRectMake(0.0,self.view.frame.size.height - 50, self.view.frame.size.width, CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height)];

Integrate share iOS / whatsapp in my app. Share Picture and text at the same time to whatsapp

Is there already a way to share the picture and the text from my app to whatsapp in one motion?
I can only find a android solution. It must be possible with iOS? Hope anybody has got the solution!
I found the solution for both picture and text over here, but Im looking for the option which android yet provides; from my app, in one motion, send a picture and text to a whatsapp contact.
Help is very much needed, tried everything and searched everywhere! Will the expert please stand up :)! Thanks in advance, hope to hear from you!
WhatsApp has a "Custom URL Scheme" and "Document Interaction" (http://www.whatsapp.com/faq/en/iphone/23559013).
But it looks like it does not support annotions for setting the text like Instagram (http://instagram.com/developer/mobile-sharing/iphone-hooks/)
This is the way to share but WITHOUT text.
self.documentationInteractionController =[UIDocumentInteractionController interactionControllerWithURL:jpegFileURL];
self.documentationInteractionController.delegate = self;
self.documentationInteractionController.UTI = #"public.jpeg";
self.documentationInteractionController.UTI = #"net.whatsapp.image";
// NOT WORKING - Found this solution, no success
self.documentationInteractionController.annotation = #{#"message":#"Text here",#"text":#"Text here"};
// NOT WORKING - Found other solution, no success
self.documentationInteractionController.annotation = [NSString stringWithFormat:#"text=Text here"];
// WORKING - BUT only for instagram
self.documentationInteractionController.annotation = #{#"InstagramCaption":#"Text here"};
[self.documentationInteractionController presentOptionsMenuFromRect:CGRectZero inView:self.view animated:YES];
Hope someone has the complete answer to the question, i am also stuck with the image and text combo.

iOS: Sign In with Google button

I am new to iOS development and working on a project where I want my users to login with Google.
I worked my way through Google's documentation, and could login in as well. All now I wanted was button/image which says "Sign in with Google" as
I looked through Google's SDK, but there is no exact image like that. so I tried to create my own which looks like
where ImageView is replaced with image in Google'e SDK.
Problem
When I run this, this doesn't look like it should
The red color of image and button do not match, neither I see vertical black line.
Question
a.) Where can I find the "Sign in with Google" button for iOS?
b.) The downloaded png might not work since as per the device we need two different resolutions #1x and #2x
Please let me know how can I get it?
UPDATE
- The problem was that the GooglePlus.bundle was not correctly loaded in my project. After fixing it, I see a button, but no text like
Has anyone seen this before?
You don't need an image that looks like this, just use the following code instead of that button and this will create a button as well as its action which will perform Google+ SSO for you.
GPPSignIn *signIn = [GPPSignIn sharedInstance];
signIn.shouldFetchGooglePlusUser = YES;
//signIn.shouldFetchGoogleUserEmail = YES; // Uncomment to get the user's email
// You previously set kClientId in the "Initialize the Google+ client" step
signIn.clientID = kClientId;
// Uncomment one of these two statements for the scope you chose in the previous step
signIn.scopes = #[ kGTLAuthScopePlusLogin ]; // "https://www.googleapis.com/auth/plus.login" scope
//signIn.scopes = #[ #"profile" ]; // "profile" scope
// Optional: declare signIn.actions, see "app activities"
signIn.delegate = self;
Just add the signIn button to your view and it should work. Here is the link in case you need any help
https://developers.google.com/+/mobile/ios/sign-in

Resources