11Sight iOS 框架。
支持本地化:英语和土耳其语。
iOS 8
CocoaPods 是 Cocoa 项目的依赖管理器。您可以使用以下命令安装它
$ gem install cocoapods
要使用 CocoaPods 将 IISightSDK 集成到您的 Xcode 项目中,请在 Podfile
中指定它
platform :ios, '8.0'
target '<Your Target Name>' do
pod 'IISightSDK'
end
然后,运行以下命令
$ pod install
或
$ pod update
如果您不希望使用任何依赖管理器,您可以手动将 IISightSDK
集成到项目中。
IISighSDK.framework
拖至 "Embedded Binaries" 部分。它还应在 "Linked Frameworks and Binaries" 下显示。
从 Xcode 9 开始,"VoIP" 被从功能中删除,您必须手动将其添加到 info.plist 中。
您的 "info.plist" 应类似于以下内容
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>voip</string>
</array>
添加以下密钥
Always Embed Swift Standard Libraries
设置为 YES
// define macro
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
@import IISightSDK;
@interface AppDelegate ()<UNUserNotificationCenterDelegate>
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
if( SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO( @"10.0" ) )
{
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
[center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error){
if( !error ){
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
}];
}
[[IISightSDKManager sharedManager] startWithPartnerUrl:@"YOUR_PARTNER_URL"];
return YES;
}
#pragma mark - iOS 8.0 Notifications
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
BOOL belongsToSDK = [[IISightSDKManager sharedManager] localNotificationBelongsToIISight:notification.category];
}
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void (^)())completionHandler {
BOOL belongsToSDK = [[IISightSDKManager sharedManager] localNotificationBelongsToIISight:notification.category];
completionHandler();
}
#pragma mark - iOS 10.0 Notifications
-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler{
BOOL belongsToSDK = [[IISightSDKManager sharedManager] localNotificationBelongsToIISight:response.actionIdentifier];
}
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler{
BOOL belongsToSDK = [[IISightSDKManager sharedManager] localNotificationBelongsToIISight:notification.request.content.categoryIdentifier];
completionHandler(UNNotificationPresentationOptionAlert);
}
- (void) login {
[[IISightSDKManager sharedManager] setLoginDelegate:self];
[[IISightSDKManager sharedManager] login_userWithEmail:@"USERNAME" password:@"PASSWORD"];
}
#pragma mark - Login Delegate
-(void)loginSuccessful{
// Successful login
}
-(void)loginFailedWithErrorMessage:(NSString *)errorMessage {
// Login failed
}
- (void) makeCall {
[[IISightSDKManager sharedManager] startOutgoingCall:@"BUTTON_ID"];
}
- (void) logout {
[[IISightSDKManager sharedManager] setLogoutDelegate:self];
[[IISightSDKManager sharedManager] logout_user];
}
#pragma mark - Logout Delegate
- (void) logoutSuccessful{
// Successful sign out
}
- (void) logoutFailedWithErrorMessage:(NSString *)errorMessage{
// Sign out failed
}
授权状态
@property (nonatomic) BOOL isLoggedIn;
当前连接状态
@property (nonatomic, assign) IISightConnectionStatus currentConnectionStatus;
来电铃声
@property (strong, nonatomic) NSString * ringtone;
带扩展名的铃声文件名。例如:"ringtone.wav"
11Sight LLC
11Sight LLC:版权所有©2017 11Sight LLC。本软件的使用受11Sight 服务条款和条件的约束。