how to activate Iad feature to iphone App - ios4

hi
i have worked in simple app in which i implement iad feature but i don't know how to activate iad feature to iphone app
plz out of snippet please give step to activate iad network and its functionality .
thanks in advance

You must be enrolled in the iOS Developer Program to join the iAd Network. Members need to do the following:
* Agree to the Developer Advertising Services Agreement in iTunes Connect.
* Set up your banking and tax information if you don’t have a paid app on the App Store.
* Enable your app for iAd ads in the Manage Your Applications module within iTunes Connect.
* Set up your iAd preferences in the iAd Network module within iTunes Connect.

You need to import the iAD Framework and also enable it for your app on iTunes Connect.
Then try the following...
iAdBanner = [[ADBannerView alloc] initWithFrame:CGRectMake(0.0, 245.0, 768.0, 66.0)];
if(&ADBannerContentSizeIdentifierPortrait != nil)
portrait = ADBannerContentSizeIdentifierPortrait;
else
portrait = ADBannerContentSizeIdentifier320x50;
if(&ADBannerContentSizeIdentifierLandscape != nil)
landscape = ADBannerContentSizeIdentifierLandscape;
else
landscape = ADBannerContentSizeIdentifier480x32;
iAdBanner.requiredContentSizeIdentifiers = [NSSet setWithObjects:landscape, nil];
iAdBanner.autoresizesSubviews = YES;
iAdBanner.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
iAdBanner.delegate = self;
[self.view addSubview:iAdBanner];
iAdBanner.hidden = NO;

Related

Navigating to a specific view from appdelegate using xamarin.ios and mvvmcross

I am working on a cross platform app using xamarin and MVVMcross.
I want to navigate to Login page when the app is in background for a specific amount of time.
I was successfull in implementing the same in android but wasn't able to find a proper solution in ios for this where MVVMCross is used.
Below is my Android code which is working
Intent intent = new Intent(this, typeof(LoginView));
var viewModelRequest = new MvxViewModelRequest(typeof(Core.ViewModels.LoginViewModel));
var serializer = new MvvmCross.Core.Parse.StringDictionary.MvxViewModelRequestCustomTextSerializer();
intent.PutExtra("MvxLaunchData", serializer.SerializeObject(viewModelRequest));
StartActivity(intent);
I need to implement the same in ios. I know I need to write a similar code like in android in WillEnterForeground method of Appdelegate but wasn't able to find a proper solution for it anywhere.
Is WillEnterForeground the right place to do this ?
Can someone please help
I was able to go one step ahead
var view = (IMvxIosView)UIStoryboard.FromName("Tasks", null).InstantiateViewController("LoginView");
var viewController = view.CreateViewControllerFor(viewModelRequest) as UIViewController;
Window.RootViewController = new UINavigationController(viewController);
Window.MakeKeyAndVisible();
Now I am able to get to the login screen when the app comes in foreground again.
But when I click the Login button nothing happens.
Just for more information i am using Storyboards and have overridden CreateIosViewsContainer method of MvxIosSetup in my Setup class.
Any help please as I am relatively very new to ios development?

Starting with Apple Pay on the web

I would like to implement Apple Pay for web. I was getting a little bit confused by the documentations of Sandbox and Production.
I'm using Mac mini (late 2012) with Sierra and iPad mini 3 with IOS 10.
Can you please help me understand what is needed for Sandbox testing? I was following: Apple Pay Sandbox Testing.
Both devices are on the same WIFI, bluetooth is on, handoff is on and AirDrop is on.
I created a sandbox user and logged in with it to icould on both devices.
I added a test credit card to the Wallet app in my iPad
Do I need to configure merchant id, certificate and merchant domain?
I'm using this simple code that I found here. I can't get canMakePayments() to return true. I receive: "ApplePay is possible on this browser, but not currently activated."
window.onload = function() {
if (window.ApplePaySession) {
var merchantIdentifier = 'example.com.store';
var promise = ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier);
promise.then(function (canMakePayments) {
if (canMakePayments) {
console.log("Hi, I can do ApplePay");
document.getElementById("applePay").style.display = "block";
}
else {
console.log("ApplePay is possible on this browser, but not currently activated.");
document.getElementById("got_notactive").style.display = "block";
}
});
}
else {
console.log("ApplePay is not available on this browser");
document.getElementById("notgot").style.display = "block";
}
}
I had similar issues with ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier) not returning true in the promise.
Using ApplePaySession.canMakePayments() instead did return true when the various conditions you mention for a sandbox user (pairing, iCloud etc.) were met on macOS Safari, and payments could be successfully handled with hand-off to iPhone and Apple Watch.
It would of course be good to determine what the missing thing is that makes ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier) seemingly not return true on macOS. It seems to work fine on iOS.
Apple Pay: sandbox vs production:
I also implemented it. So for sandbox you only need:
a sandbox merchant id
a sandbox user -> log in into the testing device with that user (you can create sandbox test user in your apple pay developer account)
you dont need to host the certificate for the sandbox environment
if you are integrating it through some third party payment provider (eg. braintree), you should set up your testing domain there (eg: http://my-sandbox-website.com)
go to the apple pay on the web website and search for test credit cards -> go to your testing device -> Wallet and add one of those credit cards there
Thats it, you're good to go :)

UIWebView Loading content properly on iOS 6 simulator but not on device?

I have encountered a weird bug with a released app. My UIWebView is no longer loading content on iOS 6, yet the content still displays in the simulator. The activity indicator displays properly but then it loads a blank url? Again, this only happens on a device, not on the simulator.
To provide extra context (in the simulator the NSURLRequest is assigned the proper URL. When run on a device the value is nil.)
Here is my code :
-(void)loading
{
if(!self.webView.loading)
[self.activityIndicator stopAnimating];
else {
[self.activityIndicator startAnimating];
}
}
- (void)viewDidLoad
{
[self.webView addSubview:self.activityIndicator];
NSURLRequest *requestUrl = [NSURLRequest requestWithURL:self.url];
[self.webView loadRequest:requestUrl];
self.timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:#selector(loading) userInfo:nil repeats:YES];
[super viewDidLoad];
NSLog(#"%#", requestUrl);
}
I had a similar issue with our web app (HTML+JS+CSS) not loading on a device, but working fine in a browser and iPhone Simulator. The cause of the issue was the wrong case in filenames. E.g., HTML file wanted to load a file 'Loader.js', whereas its name was 'loader.js'.
So, maybe you should check your 'self.url' (if your 'index.html' has the right case in its filename).
please use web view in nib and debug it to safari developer tools,
so you can trace the actual problem. I use this approach for my application and its working.
process to open developer tools
1-open safari
2-go to preference
3-go to advance option
4- set on to developer tools
After follow above process you can see your safari having option develop.
it means your safari developer tools is active and you can able to debug ios application

Launch Settings from app?

Anyone know if it's now feasible to launch the 'Settings' app from your app? Google Maps does it when you don't have Location Services enabled and you try to locate yourself.
I've seen lots of folks post about it and most answers point to adding a bug in Radar.
In the wild, I know of two apps that show this dialog with ""Turn on Location Services to Allow [app] to Determine Your Location" along side Cancel and Settings buttons where the 'Settings' button will take you to the General Settings.
1) Facebook app version 3.3.2 that runs on iOS 3.1.3 shows this alert on start. I looked at the three20 source code in git-hub but that project is not really a full source of the app but more of a library with the app's components.
2) GroupMe also shows the same alert when adding current location to a new message.
You mean the settings of the app like you see in settings?
First create a settings.bundle in xcode>newfile>settings.bundle.
This will create some prop lists that you can edit from out of the Settings.app or your app self. For the exact code Google can help you a lot further that I can. If you have any specific questions; don't hesitate to ask.
In iOS 5.0 you can open settings using the "prefs://" URL scheme. But in iOS 5.1 it doesn't work. But there is a trick I used for login twitter account using settings inside my app. the code is
TWTweetComposeViewController *tweetViewController = [[TWTweetComposeViewController alloc] init];
// Create the completion handler block.
[tweetViewController setCompletionHandler:^(TWTweetComposeViewControllerResult result)
{
[self dismissModalViewControllerAnimated:YES];
}];
// Present the tweet composition view controller modally.
[self presentModalViewController:tweetViewController animated:YES];
tweetViewController.view.hidden = YES;
for (UIView *view in tweetViewController.view.subviews){
[view removeFromSuperview];
}
Using this code you can switch to settings from your app directly if you are not already logged in twitter account.

Call to a phone number through iPhone App

Hi iPhone developers, I want to add a feature in my iPhone app, they are:
call to a phone number in my app
after call end, relaunch the previous app.
I know its not possible in iphone OS 3.2..
Is it possible in iOS 4?
I need your help...
You can't call a number directly from your app. You can use this snippet to launch the phone app:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel:12125551212"]];
... and after the call is done it will return you to your app.

Resources