Commit 7bd09de4 by zhangyunjie

添加推送

parent 955d7797
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
A966275024EBD28A0024EB54 /* Embed Frameworks */ = { A966275024EBD28A0024EB54 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase; isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 12;
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
...@@ -630,6 +630,7 @@ ...@@ -630,6 +630,7 @@
A96621F424EA83D70024EB54 /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; }; A96621F424EA83D70024EB54 /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; };
A966274B24EBA56C0024EB54 /* OffcnIMSDKiOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OffcnIMSDKiOS.h; sourceTree = "<group>"; }; A966274B24EBA56C0024EB54 /* OffcnIMSDKiOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OffcnIMSDKiOS.h; sourceTree = "<group>"; };
A966274C24EBA56C0024EB54 /* OffcnIMSDKiOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OffcnIMSDKiOS.m; sourceTree = "<group>"; }; A966274C24EBA56C0024EB54 /* OffcnIMSDKiOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OffcnIMSDKiOS.m; sourceTree = "<group>"; };
A9662CBF24ECD98B0024EB54 /* OffcnIMSDKiOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = OffcnIMSDKiOS.entitlements; sourceTree = "<group>"; };
D7DCDED1DEE7F99F223D5C73 /* Pods-OffcnIMSDKiOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OffcnIMSDKiOS.release.xcconfig"; path = "Target Support Files/Pods-OffcnIMSDKiOS/Pods-OffcnIMSDKiOS.release.xcconfig"; sourceTree = "<group>"; }; D7DCDED1DEE7F99F223D5C73 /* Pods-OffcnIMSDKiOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OffcnIMSDKiOS.release.xcconfig"; path = "Target Support Files/Pods-OffcnIMSDKiOS/Pods-OffcnIMSDKiOS.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -680,6 +681,7 @@ ...@@ -680,6 +681,7 @@
A9661B4224EA64EE0024EB54 /* OffcnIMSDKiOS */ = { A9661B4224EA64EE0024EB54 /* OffcnIMSDKiOS */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A9662CBF24ECD98B0024EB54 /* OffcnIMSDKiOS.entitlements */,
A966274724EBA36A0024EB54 /* ExposedInterface-(外放接口) */, A966274724EBA36A0024EB54 /* ExposedInterface-(外放接口) */,
A9661FC824EA7AD10024EB54 /* Common-(宏) */, A9661FC824EA7AD10024EB54 /* Common-(宏) */,
A9661F8124EA7AD10024EB54 /* Tools-(工具) */, A9661F8124EA7AD10024EB54 /* Tools-(工具) */,
...@@ -1868,6 +1870,7 @@ ...@@ -1868,6 +1870,7 @@
baseConfigurationReference = 3F07C2EC97AF605DC6BD528E /* Pods-OffcnIMSDKiOS.debug.xcconfig */; baseConfigurationReference = 3F07C2EC97AF605DC6BD528E /* Pods-OffcnIMSDKiOS.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = OffcnIMSDKiOS/OffcnIMSDKiOS.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = LA78A3696S; DEVELOPMENT_TEAM = LA78A3696S;
...@@ -1876,6 +1879,10 @@ ...@@ -1876,6 +1879,10 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/OffcnIMSDKiOS", "$(PROJECT_DIR)/OffcnIMSDKiOS",
); );
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/OffcnIMSDKiOS",
);
INFOPLIST_FILE = OffcnIMSDKiOS/Info.plist; INFOPLIST_FILE = OffcnIMSDKiOS/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
...@@ -1887,9 +1894,9 @@ ...@@ -1887,9 +1894,9 @@
"-ObjC", "-ObjC",
"$(inherited)", "$(inherited)",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.eoffcn.questions; PRODUCT_BUNDLE_IDENTIFIER = com.eoffcn.classonline;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = WXQuestionDev; PROVISIONING_PROFILE_SPECIFIER = ClassonlineDev;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
...@@ -1899,6 +1906,7 @@ ...@@ -1899,6 +1906,7 @@
baseConfigurationReference = D7DCDED1DEE7F99F223D5C73 /* Pods-OffcnIMSDKiOS.release.xcconfig */; baseConfigurationReference = D7DCDED1DEE7F99F223D5C73 /* Pods-OffcnIMSDKiOS.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = OffcnIMSDKiOS/OffcnIMSDKiOS.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = LA78A3696S; DEVELOPMENT_TEAM = LA78A3696S;
...@@ -1907,6 +1915,10 @@ ...@@ -1907,6 +1915,10 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/OffcnIMSDKiOS", "$(PROJECT_DIR)/OffcnIMSDKiOS",
); );
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/OffcnIMSDKiOS",
);
INFOPLIST_FILE = OffcnIMSDKiOS/Info.plist; INFOPLIST_FILE = OffcnIMSDKiOS/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
...@@ -1917,9 +1929,9 @@ ...@@ -1917,9 +1929,9 @@
"-ObjC", "-ObjC",
"$(inherited)", "$(inherited)",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.eoffcn.questions; PRODUCT_BUNDLE_IDENTIFIER = com.eoffcn.classonline;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = WXQuestionDev; PROVISIONING_PROFILE_SPECIFIER = ClassonlineDev;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Release; name = Release;
......
...@@ -38,10 +38,12 @@ ...@@ -38,10 +38,12 @@
//获取网络状态和内部初始化处理 //获取网络状态和内部初始化处理
[[OffcnIMSDKiOS defaultService] startNotifierUseRealReachability]; [[OffcnIMSDKiOS defaultService] startNotifierUseRealReachability];
//推送
[self registerOffcnUserNotificationSettingsWithApplication:application options:launchOptions];
return YES; return YES;
} }
- (void)applicationWillResignActive:(UIApplication *)application { - (void)applicationWillResignActive:(UIApplication *)application {
} }
...@@ -64,7 +66,117 @@ ...@@ -64,7 +66,117 @@
- (void)applicationWillTerminate:(UIApplication *)application { - (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
} }
- (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler{ - (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler{
} }
-(void)registerOffcnUserNotificationSettingsWithApplication:(UIApplication *)application options:(NSDictionary *)launchOptions{
// application.applicationIconBadgeNumber = 0;
if ([UIDevice currentDevice].systemVersion.doubleValue >= 8.0){
// 1.请求授权可以给用户发送通知
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeSound | UIUserNotificationTypeBadge | UIUserNotificationTypeAlert categories:nil];
[application registerUserNotificationSettings:settings];
}else{
[application registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound];
}
if (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]){
// 跳转
}
}
/**
* 远程推送注册成功
*
* @param deviceToken deviceToken
*/
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
// 25bb75ac 3ffcebd7 90d9f517 1ebca904 154a367a 87781e5d b9ea288e 37fdf487
NSLog(@"-----deviceToken ---- ---- %@ devDesc ---%@", deviceToken,deviceToken.description);
//tokenStr 得到可用的token。
NSString *tokenStr = [NSString stringWithFormat:@"%@",deviceToken];
tokenStr = [tokenStr stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];//将其中的<>去掉
tokenStr = [tokenStr stringByReplacingOccurrencesOfString:@" " withString:@""];//将其中的空格去掉
NSString *str = [self hexStringForData:deviceToken];
NSLog(@"token--- %@",str);
//注册成功,返回token
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"APNS返回的Token:" message:tokenStr delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show];
// applicationIconBadgeNumber
}
-(NSString *)hexStringForData:(NSData *)data{
if (data == nil) {
return nil;
}
NSMutableString *hexString = [NSMutableString string];
const unsigned char *p = [data bytes];
for (int i=0; i < [data length]; i++) {
[hexString appendFormat:@"%02x", *p++];
}
return hexString;
}
/**
* 注册失败
*
*/
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{
NSLog(@"注册失败 ---- %@",error);
NSString *tokenStr = [NSString stringWithFormat:@"%@",error];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"注册失败!" message:tokenStr delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show];
NSLog(@"注册失败%@",error);
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
NSLog(@"接收到推送通知 ---- %@", userInfo);
/*
"name" : "YFPushTest",
"action_type" : "1",
"message" : "您的车辆京KKKKKK于2016-4-22 驶入邯郸",
"aps" : {
"alert" : "This is some fancy message.",
"badge" : 1,
"sound" : "您的车辆京KKKKKK于2016-4-22 驶入邯郸"
};
*/
// application.applicationIconBadgeNumber -=1;
//将推送消息以alert形式呈现
NSString *message = [[userInfo objectForKey:@"aps"]objectForKey:@"alert"];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:message delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show];
}
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings{
NSLog(@"ls---- %@",notificationSettings);
// 2.注册远程通知
[application registerForRemoteNotifications];
}
- (void)application:(UIApplication *)application handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void(^)(void))completionHandler{
NSLog(@"ios9新增 --- %@ -- %@ --- %@",identifier,userInfo,responseInfo);
}
- (void)application:(UIApplication *)application handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)(void))completionHandler{
NSLog(@"ios8新增 --- %@ -- %@ --- %@",identifier,userInfo,application);
}
@end @end
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TnX-iH-azN"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TnX-iH-azN">
<rect key="frame" x="15" y="90" width="62" height="30"/> <rect key="frame" x="15" y="130" width="62" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="发送消息"/> <state key="normal" title="发送消息"/>
<connections> <connections>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9JE-Lz-Dma"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9JE-Lz-Dma">
<rect key="frame" x="15" y="160" width="123" height="30"/> <rect key="frame" x="15" y="200" width="123" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="用户信息标记已读"/> <state key="normal" title="用户信息标记已读"/>
<connections> <connections>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1dp-RW-FhV"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1dp-RW-FhV">
<rect key="frame" x="15" y="125" width="153" height="30"/> <rect key="frame" x="15" y="165" width="153" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="获取会话未读消息列表"/> <state key="normal" title="获取会话未读消息列表"/>
<connections> <connections>
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F7y-mH-mpC"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F7y-mH-mpC">
<rect key="frame" x="15" y="195" width="153" height="30"/> <rect key="frame" x="15" y="235" width="153" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="获取用户最近会话记录"/> <state key="normal" title="获取用户最近会话记录"/>
<connections> <connections>
...@@ -78,13 +78,21 @@ ...@@ -78,13 +78,21 @@
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7fD-Hf-Afy"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7fD-Hf-Afy">
<rect key="frame" x="15" y="230" width="153" height="30"/> <rect key="frame" x="15" y="270" width="153" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="获取会话历史消息列表"/> <state key="normal" title="获取会话历史消息列表"/>
<connections> <connections>
<action selector="historyMegListAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="5oc-rs-t23"/> <action selector="historyMegListAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="5oc-rs-t23"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dRe-f0-gnl">
<rect key="frame" x="15" y="95" width="62" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="建立连接"/>
<connections>
<action selector="connectAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="PbK-7D-LjH"/>
</connections>
</button>
</subviews> </subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
...@@ -92,7 +100,10 @@ ...@@ -92,7 +100,10 @@
<constraint firstItem="F7y-mH-mpC" firstAttribute="leading" secondItem="TnX-iH-azN" secondAttribute="leading" id="6b7-ni-Ag1"/> <constraint firstItem="F7y-mH-mpC" firstAttribute="leading" secondItem="TnX-iH-azN" secondAttribute="leading" id="6b7-ni-Ag1"/>
<constraint firstAttribute="trailing" secondItem="so4-rI-aRi" secondAttribute="trailing" id="83W-xz-1xP"/> <constraint firstAttribute="trailing" secondItem="so4-rI-aRi" secondAttribute="trailing" id="83W-xz-1xP"/>
<constraint firstItem="1dp-RW-FhV" firstAttribute="top" secondItem="TnX-iH-azN" secondAttribute="bottom" constant="5" id="8dX-xU-6MF"/> <constraint firstItem="1dp-RW-FhV" firstAttribute="top" secondItem="TnX-iH-azN" secondAttribute="bottom" constant="5" id="8dX-xU-6MF"/>
<constraint firstItem="dRe-f0-gnl" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="15" id="A4C-6b-WCr"/>
<constraint firstItem="so4-rI-aRi" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="Acv-YJ-6xY"/> <constraint firstItem="so4-rI-aRi" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="Acv-YJ-6xY"/>
<constraint firstItem="dRe-f0-gnl" firstAttribute="top" secondItem="so4-rI-aRi" secondAttribute="bottom" constant="10" id="AvN-lQ-0c4"/>
<constraint firstItem="TnX-iH-azN" firstAttribute="top" secondItem="dRe-f0-gnl" secondAttribute="bottom" constant="5" id="F5X-lo-zs2"/>
<constraint firstItem="F7y-mH-mpC" firstAttribute="height" secondItem="TnX-iH-azN" secondAttribute="height" id="HV9-jc-VLg"/> <constraint firstItem="F7y-mH-mpC" firstAttribute="height" secondItem="TnX-iH-azN" secondAttribute="height" id="HV9-jc-VLg"/>
<constraint firstItem="F7y-mH-mpC" firstAttribute="top" secondItem="9JE-Lz-Dma" secondAttribute="bottom" constant="5" id="HdJ-KZ-Mo0"/> <constraint firstItem="F7y-mH-mpC" firstAttribute="top" secondItem="9JE-Lz-Dma" secondAttribute="bottom" constant="5" id="HdJ-KZ-Mo0"/>
<constraint firstItem="so4-rI-aRi" firstAttribute="top" secondItem="HDM-va-7kG" secondAttribute="bottom" constant="5" id="JGR-v7-Dr6"/> <constraint firstItem="so4-rI-aRi" firstAttribute="top" secondItem="HDM-va-7kG" secondAttribute="bottom" constant="5" id="JGR-v7-Dr6"/>
...@@ -106,7 +117,6 @@ ...@@ -106,7 +117,6 @@
<constraint firstItem="HDM-va-7kG" firstAttribute="top" secondItem="a21-3W-10n" secondAttribute="bottom" id="lS8-hA-rmu"/> <constraint firstItem="HDM-va-7kG" firstAttribute="top" secondItem="a21-3W-10n" secondAttribute="bottom" id="lS8-hA-rmu"/>
<constraint firstItem="7fD-Hf-Afy" firstAttribute="leading" secondItem="TnX-iH-azN" secondAttribute="leading" id="lea-oR-ecV"/> <constraint firstItem="7fD-Hf-Afy" firstAttribute="leading" secondItem="TnX-iH-azN" secondAttribute="leading" id="lea-oR-ecV"/>
<constraint firstItem="1dp-RW-FhV" firstAttribute="height" secondItem="TnX-iH-azN" secondAttribute="height" id="pCJ-es-iPl"/> <constraint firstItem="1dp-RW-FhV" firstAttribute="height" secondItem="TnX-iH-azN" secondAttribute="height" id="pCJ-es-iPl"/>
<constraint firstItem="TnX-iH-azN" firstAttribute="top" secondItem="so4-rI-aRi" secondAttribute="bottom" constant="5" id="pCV-ca-w4c"/>
<constraint firstItem="9JE-Lz-Dma" firstAttribute="top" secondItem="1dp-RW-FhV" secondAttribute="bottom" constant="5" id="xMf-AL-l1H"/> <constraint firstItem="9JE-Lz-Dma" firstAttribute="top" secondItem="1dp-RW-FhV" secondAttribute="bottom" constant="5" id="xMf-AL-l1H"/>
</constraints> </constraints>
</view> </view>
......
...@@ -2,11 +2,6 @@ ...@@ -2,11 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
...@@ -25,6 +20,15 @@ ...@@ -25,6 +20,15 @@
<string>1</string> <string>1</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key> <key>UIRequiredDeviceCapabilities</key>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "ViewController.h" #import "ViewController.h"
#import "OffcnIMSDKiOS.h" #import "OffcnIMSDKiOS.h"
#import "OffcnNetworkExecutor.h" #import "OffcnNetworkExecutor.h"
//#import "oimcoreAdapter.h"
@interface ViewController ()<UITextFieldDelegate> @interface ViewController ()<UITextFieldDelegate>
...@@ -37,6 +38,10 @@ ...@@ -37,6 +38,10 @@
- (IBAction)clickExitKeyboardAction:(UIButton *)sender { - (IBAction)clickExitKeyboardAction:(UIButton *)sender {
[self.view endEditing:YES]; [self.view endEditing:YES];
} }
- (IBAction)connectAction:(UIButton *)sender {
}
- (IBAction)sendMeg:(UIButton *)sender { - (IBAction)sendMeg:(UIButton *)sender {
//发送消息 //发送消息
[OffcnNetworkExecutor requestSendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:self.msg_type msg:self.dataDic Finished:^(BOOL success, id response, BaseResponse *baseResponse) { [OffcnNetworkExecutor requestSendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:self.msg_type msg:self.dataDic Finished:^(BOOL success, id response, BaseResponse *baseResponse) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment