uiapplicationdelegate

iOS deep linking

五迷三道 提交于 2021-02-08 05:20:15
问题 I've integrated custom url calls to link to specific pages on my app with the url scheme definitions example: myapp://?id=123 the problem is that I am not sure how to cause the ios to go to the appstore if my app is not installed on the specific device ( just like Pinterest ). 回答1: UIApplication has a canOpenURL: method that you can use to query the system to check if it can handle a URL with your custom scheme. If it can then you can open the URL and know your app is installed. If it can't

iOS - setIdleTimerDisabled:NO Not Working

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 13:52:14
问题 I have an app that utilizes the video camera so the screen cannot dim. Inhibiting the screen from dimming works fine like so: - (void)applicationDidBecomeActive:(UIApplication *)application { [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; } However when the app is closed and enters the background, setting the IdleTimer back to NO is not working. The screen stays on forever on the home screen. This is how I am trying to accomplish this. - (void)applicationWillResignActive:

How to detect if code is running in Main App or App Extension Target?

牧云@^-^@ 提交于 2020-02-12 07:28:06
问题 Does anyone know how you detect from within your code if you're running inside an App Extension? I have an app which shares classes between an app and an extension. The app code uses [UIApplication sharedApplication] but this isn't available from within an extension, so it won't compile saying: 'sharedApplication' is unavailable: not available iOS (App Extension) So I need a way to detect that I'm in the extension and use an alternative to sharedApplication if that's the case. 回答1: You can

Get Apple's remote push notifications even after app terminates

倖福魔咒の 提交于 2020-01-20 08:18:27
问题 I am developing an iOS app which receives apple's remote push notifications at a particular time interval. The notifications are received successfully when app is active as well as when app is in background. But when app is terminated from app switcher/dock, notifications are not received until the app is started again. I have tried following code to keep app alive in background. This same code is implemented in applicationWillTerminate: method, but it did not work. __block

Get Apple's remote push notifications even after app terminates

孤街醉人 提交于 2020-01-20 08:18:05
问题 I am developing an iOS app which receives apple's remote push notifications at a particular time interval. The notifications are received successfully when app is active as well as when app is in background. But when app is terminated from app switcher/dock, notifications are not received until the app is started again. I have tried following code to keep app alive in background. This same code is implemented in applicationWillTerminate: method, but it did not work. __block

isKindOfClass and NSStringFromClass disagree about UIApplicationDelegate

笑着哭i 提交于 2020-01-09 19:26:08
问题 I was playing with a simple OCUnit test for an iPhone app, and just wanted to assert that the app delegate was an instance of the class that I expected it to be. I didn't expect this test to be very useful, but it turned out to reveal a misunderstanding that I have regarding Objective C. I first get a reference to the delegate. Then I log the class name of what comes back. In my case, the output correctly says "app delegate's class name is CalculatorAppDelegate". However, the assertion on the

isKindOfClass and NSStringFromClass disagree about UIApplicationDelegate

冷暖自知 提交于 2020-01-09 19:23:46
问题 I was playing with a simple OCUnit test for an iPhone app, and just wanted to assert that the app delegate was an instance of the class that I expected it to be. I didn't expect this test to be very useful, but it turned out to reveal a misunderstanding that I have regarding Objective C. I first get a reference to the delegate. Then I log the class name of what comes back. In my case, the output correctly says "app delegate's class name is CalculatorAppDelegate". However, the assertion on the

data between Views UIApplication

落花浮王杯 提交于 2020-01-06 12:44:17
问题 i want to share data between views... i have the appdelegate of tabbar application: myappdelegate.h #import <UIKit/UIKit.h> @interface myappdelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> { UIWindow *window; UITabBarController *tabBarController; NSString *result; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; @property (copy , readwrite) NSString *result; @end if i want to call

How to swap between 2 root view controllers

两盒软妹~` 提交于 2020-01-06 05:49:30
问题 I have a game with two rootViewControllers - one for the Menu and the other for the Game itself. When the user switches between the Game and the Menu, I want to switch the rootViewController. Ultimately my questions is, what is the best way to do this? Or is there another approach for switching stacks that makes more sense than having 2 rootViewControllers? As it stands, I have an instance of a navigationController in my appDelegate. When I want to switch rootViewController, I initialise a

How implement scheduling event with post a message on fb

五迷三道 提交于 2020-01-05 04:42:10
问题 I am creating an application in which I have add a facility for post message on ur account. Now this facility I am adding an event for scheduling. With help of that user can write a message and post that later or on particular date and time. For this I used a local notification event which is generate on given date by user. But problem is that when notification generate then I have call a function which is used for post message on Facebook. For generate notification I have used this code: -