|
|
@@ -11,6 +11,8 @@
|
|
|
#import "RAHomeViewController.h"
|
|
|
#import <CoreLocation/CoreLocation.h>
|
|
|
|
|
|
+static const NSInteger OrderTypeNew = 2;
|
|
|
+
|
|
|
@interface AppDelegate ()<UNUserNotificationCenterDelegate,CLLocationManagerDelegate>
|
|
|
|
|
|
@property (nonatomic,strong) CLLocationManager *locationManager;
|
|
|
@@ -21,10 +23,11 @@
|
|
|
|
|
|
#pragma mark - Private
|
|
|
|
|
|
-- (void)showHomeVCWithOrderID:(NSString *)orderID {
|
|
|
+- (void)showHomeVCWithOrderID:(NSString *)orderID type:(NSInteger)type {
|
|
|
|
|
|
RAHomeViewController *homeVC = [RAHomeViewController viewControllerFromStoryboard];
|
|
|
homeVC.gotoDetailID = orderID;
|
|
|
+ homeVC.gotoDetailType = type;
|
|
|
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:homeVC];
|
|
|
self.window.rootViewController = nav;
|
|
|
}
|
|
|
@@ -38,7 +41,7 @@
|
|
|
|
|
|
[[RASingleton sharedInstance] loginUser:user password:password];
|
|
|
|
|
|
- [weakSelf showHomeVCWithOrderID:nil];
|
|
|
+ [weakSelf showHomeVCWithOrderID:nil type:OrderTypeNew];
|
|
|
};
|
|
|
|
|
|
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:rootVC];
|
|
|
@@ -113,10 +116,13 @@
|
|
|
// Override point for customization after application launch.
|
|
|
|
|
|
NSString *orderID = nil;
|
|
|
+ NSInteger orderType = OrderTypeNew;
|
|
|
if (launchOptions) {
|
|
|
NSDictionary *userInfo = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
|
|
|
NSDictionary *aps = [userInfo objectForKey:@"aps"];
|
|
|
orderID = [aps objectForKey:@"order-id"];
|
|
|
+ orderType = [[aps objectForKey:@"order-type"] integerValue];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// View
|
|
|
@@ -125,7 +131,7 @@
|
|
|
self.window.backgroundColor = [UIColor whiteColor];
|
|
|
|
|
|
if (RASingleton.sharedInstance.autoLogin) {
|
|
|
- [self showHomeVCWithOrderID:orderID];
|
|
|
+ [self showHomeVCWithOrderID:orderID type:orderType];
|
|
|
} else {
|
|
|
[self showLoginVC];
|
|
|
}
|
|
|
@@ -210,8 +216,9 @@
|
|
|
NSDictionary *userInfo = response.notification.request.content.userInfo;
|
|
|
NSDictionary *aps = [userInfo objectForKey:@"aps"];
|
|
|
NSString *orderID = [aps objectForKey:@"order-id"];
|
|
|
+ NSInteger orderType = [[aps objectForKey:@"order-type"] integerValue];
|
|
|
if (orderID) {
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationName:RANotificationGoDetail object:@{@"orderID" : orderID}];
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:RANotificationGoDetail object:@{@"orderID" : orderID,@"orderType" : @(orderType)}];
|
|
|
}
|
|
|
|
|
|
completionHandler();
|
|
|
@@ -249,6 +256,7 @@
|
|
|
},
|
|
|
"new-order" : 1,
|
|
|
"order-id" : "AFS20180530001200",
|
|
|
+ "order-type" : 2,
|
|
|
"sound" : "default",
|
|
|
"content-available" : 1
|
|
|
}
|