123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- //
- // AppDelegate.m
- // NatureDemo
- //
- // Created by SAGESSE on 2019/1/20.
- // Copyright © 2019 SAGESSE. All rights reserved.
- //
- #import "AppDelegate.h"
- #import <FBSDKCoreKit/FBSDKCoreKit.h>
- #import <FBSDKLoginKit/FBSDKLoginKit.h>
- #import "XenonSDK.h"
- @interface AppDelegate ()
- @end
- @implementation AppDelegate
- #pragma mark - ==========AdjustDelegate==========
- - (void)adjustAttributionChanged:(nullable ADJAttribution *)attribution {
- //...
- }
- ///事件跟踪成功
- - (void)adjustEventTrackingSucceeded:(nullable ADJEventSuccess *)eventSuccessResponseData {
- //...
- }
- ///事件跟踪失败
- - (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData {
- //...
- }
- ///会话跟踪成功
- - (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData {
- //...
- }
- ///会话跟踪失败
- - (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData {
- //...
- }
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- // Override point for customization after application launch.
-
- //1.facebook SDK init
- [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
-
- //2.Adjust SDK init
- NSString *appToken = [NSBundle mainBundle].infoDictionary[@"kAppToken"];
- NSString *environment = ADJEnvironmentSandbox;
- //开发:ADJEnvironmentSandbox, 线上:ADJEnvironmentProduction
- ADJConfig *adjustConfig = [ADJConfig configWithAppToken:appToken environment:environment];
- [adjustConfig setLogLevel:ADJLogLevelVerbose];
- [adjustConfig setSendInBackground:YES];
- [adjustConfig setDelegate:self];
- //[adjustConfig setDelayStart:5.5];
- [Adjust appDidLaunch:adjustConfig];
-
-
- //3.login&apply SDK init
- [XenonSDK.sharedSDK initWithParameter:@"20303|1105|910260&fscsIOS_IOS_0001" complete:^(NSError * error) {
- //检查是否有漏单
- [XenonSDK.sharedSDK checkOrderStatus];
- //登录
- [XenonSDK.sharedSDK loginWithComplete:^(id user, NSError * error) {
- NSLog(@"SDK初始化成功");
- }];
- }];
-
- //4. firebase SDK init
- [FIRApp configure];
-
- return YES;
- }
- - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
- [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url options:options];
-
-
- return YES;
-
- }
- - (void)applicationWillResignActive:(UIApplication *)application {
- // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
- // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
- }
- - (void)applicationDidEnterBackground:(UIApplication *)application {
- // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
- // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
- }
- - (void)applicationWillEnterForeground:(UIApplication *)application {
- // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
- }
- - (void)applicationDidBecomeActive:(UIApplication *)application {
- // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
- }
- - (void)applicationWillTerminate:(UIApplication *)application {
- // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
- }
- //设置成横屏.
- - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
- if (window.rootViewController.presentedViewController.parentViewController != nil) {
- return UIInterfaceOrientationMaskAll;
- }
- return UIInterfaceOrientationMaskLandscape;
- }
- @end
|