RevMob top banner doesn't hide iphone sdk - iphone

In my apps i'm used RevMob sdk for advertisement. In First view advertisement banner is shown using this code.
[RevMobAds showBannerAdWithAppID:#"xxxxxxxxxxxxxx"];
And in second view i'm hide the banner using the code..
[RevMobAds hideBannerAdWithAppID:#"xxxxxxxxxxxxxxxxxxx"];
This code run perfectly banner is shown in first view and hide in another view.
But my problem is this when i'm writing code to show popup in appilicationdidbecomeactivemethod:
- (void)applicationDidBecomeActive:(UIApplication *)application
{
[RevMobAds showPopupAdWithAppID:#"xxxxxxxxxxxxx"];
}
Then in second view bannerAdd is not hide it will still appear in the second view.
I'm not able to realize what is the problem. if u have any suggestion plz help me...
Thanks in advance.

The methods that you are using are deprecated, you should use:
[RevMobAds showBannerAd];
[RevMobAds hideBannerAd];
[RevMobAds showPopup];
You can see more on the api documentation:
http://sdk.revmob.com/ios-api/index.html

Related

xCode 4.6 - Status bar not appearing even when enabled for app

I started making updates to my app today. When I launch it in iOS Simulator (running xCode 4.6) the status bar is not visible during app launch (this is how I want it set, and how my app is setup in xCode) but then it is also not visible when I get to my Tab Bar Controller view and all my UIViewControllers (I have a tab based nav app).
The problem this creates is that the UIViewControllers, when displayed on a 4-inch display in iOS Simulator, it creates a small white space above the bottom Tab navigation bar (the height of which matches a status bar). I tried reverting my app to a previous backup but still can't get this fixed.
Help is appreciated. Thanks!
Using latest version of xCode (4.6)
iOS SDK 6.1
Try putting this when you want the status bar to reappear:
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
Hope this solves it.
OK write this line: [[UIApplication sharedApplication]setStatusBarHidden:NO];
in your appdelegate.m class under this method: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions & then check.

Keyboard shows then immediately hides itself when showing MFMessageComposeViewController

I am building a PhoneGap app using Cordova 2.2 for IOS. I am experiencing some bizarre behavior when calling out to a native obj-c plugin I have written to show the MFMessageComposeViewController.
The setup is very simple - I have a tap event attached to a UI element, that when pressed, will make a call to my PhoneGap plugin, pass with it a number and a text message, then show the MFMessageComposeViewController with the parameters pre-populated.
My javascript looks like this:
$(document).bind('deviceready', function(){
$(".theButton").tap(function(){
cordova.exec(function(){}, function() {}, "PhoneGapSms", "SendSms", [db.getItem("profile_sms"), db.getItem("profile_emergency")]);
});
});
And my obj-c code looks like this:
- (void)SendSms:(CDVInvokedUrlCommand*)command
{
CDVInvokedUrlCommand* myCommand = command;
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
NSString* body = [command.arguments objectAtIndex:0];
NSString* toRecipientsString = [command.arguments objectAtIndex:1];
if(body != nil)
picker.body = body;
if(toRecipientsString != nil)
[picker setRecipients:[ toRecipientsString componentsSeparatedByString:#","]];
picker.messageComposeDelegate = self;
[self.viewController presentModalViewController:picker animated:YES];
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[picker release];
}
So, all in all, very simple stuff.
My Problem is this:
When my iPhone is plugged into my Mac and the app is run from XCode, the Message Composer overlay appears great, with my values pre-populated. Image below demonstrating the SMS interface appears fine while plugged into XCode:
When my iPhone is unplugged from my Mac, and the app is run from the spring board, the Overlay slides up, the keyboard begins to slide up, then immediately slides down - making it impossible to type or send the message. This is what it looks like when not attached to the Mac/Xcode - the keyboard begins to slide up then immediately slides down (~ < 1 sec) leaving the following interface:
I can't for the life of me figure out what would cause the keyboard to hide when not running from XCode, but work perfectly well when it is.
Is there any way to 'force' the keyboard to display, or possibly put the whole modalviewcontroller as first responder in some form or fashion?
Any suggestions are appreciated!
Edit:
The keyboard WILL appear again if you click in the contact area
You must add MessageUI.framework to your Xcode project and include a
#import <MessageUI/MessageUI.h> in your header file.
try this code may be its helpful to you..
[self presentModalViewController:picker animated:YES];
//[self becomeFirstResponder];//try picker also instead of self
Also Refer this bellow tutorial and also check demo..
new-tutorial-developing-and-architecting-a-phonegap-application
SMSComposer
i hope this help you...
I encountered these symptoms with a Sencha Touch 2.2 and Cordova 2.6.0 setup (specifically, iOS 6+ devices).
The issue was with the web framework stealing focus away from the native SMS Composer modal, typically occurring after the first SMS Composer modal had been successfully displayed and closed.
A event.preventDefault() and event.stopPropagation() call once the event had been fired (or event.stopEvent() in Sencha land) resolved this.
Hope this helps,
-James
First: The most likely culprit, without seeing your code, is that your parent (presenting) view controller may have an action in its viewWillDisappear or viewDidDisappear that is affecting who has the "first" responder. These methods get called when presenting a view controller modally. It may be behaving differently on the simulator than the device due to timing - often really close timing conditions are different on the ARM device and the i386 processor.
Second: Does anywhere in your app register for the UIKeyboardWillShowNotification or the UIKeyboardDidShowNotification? If so, put breakpoints in the methods that are called as a result - it's possible some other controller in your view hierarchy is interfering with this one.
To answer your question...
Is there any way to 'force' the keyboard to display, or possibly put the whole modalviewcontroller as first responder in some form or fashion?
No to both. The only way to make the keyboard display is to call the becomeFirstResponder method of the input view. Since Apple doesn't expose the text view, you cannot send it messages. Setting the modalViewController as first responder would be setting the wrong object.
I found the same type of issue But Not Sure it will Solve your problem or not Just Have a Look on the Following Links :
1. http://community.phonegap.com/nitobi/topics/keyboard_is_not_triggerd_in_my_ios_build
2. https://github.com/phonegap/build/issues/31
If its not Solving your issue then you can Download the Sample code Here.
Link: https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/SMSComposer

uibarbutton and popoverview on iPhone

I am looking for a great tutorial to implement a popoverview on iPhone all I found so far is talking about the ipad or is crashing
You cannot implement the UIPopover in iPhone.
Please refer UIElementGuidelines
For a nice popover tutorial check this site.
For popover in iPhone use the following Open source controls:
FPPopover
ModalView in iPhone
KGModal
MJPopupviewcontroller
UAmodalpanel
RNBlurmodalview
For more check this site
you cannot implement the standard popoverview in iphone. Have to make a custom view that replicate the popoverview.
Check these :
http://www.50pixels.com/blog/labs/open-library-fppopover-ipad-like-popovers-for-iphone/
This May help you great sample code you can find
https://github.com/takashisite/TSPopover
https://github.com/kyoshikawa/ZPopoverController
https://github.com/ddebin/DDPopoverBackgroundView
https://github.com/werner77/WEPopover

iAd Doesn't Animate Ad Appearance

I'm implementing iAd in my app using the paradigms for a multi-VC app that apple demonstrates in their sample code (e.g. TabbedBanner and NavigationBanner). If you're not familiar with it, the paradigm is essentially to have the main app delegate serve as the primary AdBannerViewDelegate, and share the banner view across your respective view controllers.
My ads are appearing fine throughout the app, without any warnings. The problem is that for some reason when I click an ad banner, it doesn't navigate the appearance of the ad (should slide up from the bottom). There's just a delay and then the ad appears. But when I dismiss the ad it animates fine.
The appearance animates fine in apple's sample code, so the problem lies somewhere in my code. I'm just not sure where because I haven't changed much in the iAd implementation. My bannerViewActionShouldBegin is just
- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave
{
[[NSNotificationCenter defaultCenter] postNotificationName:BannerViewActionWillBegin object:self];
return YES;
}
But I don't think the problem lies in the NotificationCenter, because if I comment out that bit and just do
- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave
{
return YES;
}
The problem remains.
Any ideas? I can post more code, but my digging around in the documentation hasn't revealed anything that would flip an animated BOOL for ad presentation.
Thanks in advance.
FWIW, the best I could figure is that this seems to simply be an iOS version issue. In 4.0 it fails to animate. In 5.0 it animates.

iPhone Status bar disappearing in app using KTPhotoBrowser gallery when moving between KTPhotoScrollViewController and KTThumbsViewController

I'm using the KTPhotoBrowser library to create a photo gallery in my iPhone app. The gallery consists of a thumbnail view (KTThumbsViewController) and a scroll view (KTPhotoScrollViewController) which displays the full size photos like in the official iPhone photo app.
I've managed to get everything working fine but sometimes when navigating back to the thumbnail view from the photo scroll view the status bar disappears leaving a 20px black gap at the top of the screen where the status bar once was.
This has a serious knock on effect for the whole navigation stack as the views dimensions alter from being (320,416) to (320,436) resulting in everything shifting up 20px.
Has anyone else encountered this issue and if so have you been able to resolve it?
I have managed to come up with an interim solution which prevents the app from breaking.
In KTPhotoScrollViewController.m I have commented out the following code in the toggleChrome method:
/* if ([[UIApplication sharedApplication] respondsToSelector:#selector(setStatusBarHidden:withAnimation:)]) {
[[UIApplication sharedApplication] setStatusBarHidden:hide withAnimation:NO];
} else { // Deprecated in iOS 3.2+.
id sharedApp = [UIApplication sharedApplication]; // Get around deprecation warnings.
[sharedApp setStatusBarHidden:hide animated:NO];
} */
This means that the status bar never hides and as a result the issue of it disappearing when transitioning between views never occurs.