大使 1.1.4

大使 1.1.4

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2019年1月

Jay LloydMatt MajewskiMarko Corokalo维护。



大使 1.1.4

  • 作者
  • Matt Majewski

大使iOS SDK

如何安装iOS SDK?

首选的安装框架方法是用CocoaPods。在Podfile中添加以下依赖项

pod 'Ambassador', '1.1.2'

如果您不使用CocoaPods,请按照以下步骤在Objective-C或Swift项目中安装大使SDK。

  • 下载 SDK 压缩文件,解压它,并将包含的框架和束文件拖放到项目文件下的项目下面(压缩文件附在本文章的底部)。

  • 选择将SDK文件复制到您的项目中。

  • 转到构建阶段并链接到以下库

    • libicucore
  • 在“构建设置 > 其他链接器标志”下添加“-ObjC”和“-lstdc++”标志

添加桥接头(Swift项目)

SDK是用Objective-C编写的。除了之前的步骤外,将SDK安装到Swift项目中还需要一个桥接头。如果您项目中还没有桥接头,可以轻松添加一个。如果您已经有桥接头(由于其他库或框架),请转到配置桥接头(Swift项目)

  • 在您的项目中添加一个新文件。

  • 选择Objective-C文件类型。

  • 这实际上是一个虚拟文件,可以命名为任何名称。

  • 将出现一个提示,询问您是否要配置桥接头。选择是。

  • 这将创建一个虚拟的Objective-C文件,并为您的项目名称创建一个共享名称的桥接头。

  • 此时,您可以删除虚拟的Objective-C文件。它不再需要。

配置跨接头(Swift项目)

在跨接头中添加对Ambassador SDK的导入语句。

#import <Ambassador/Ambassador.h>

初始化Ambassador

  1. 如果你正在使用Objective-C,在你的AppDelegate.m中导入Ambassador框架。

Objective-C

#import <Ambassador/Ambassador.h>
  1. 你需要在你的AppDelegate.m中的application:didFinishLaunchingWithOptions:函数内部运行Ambassador。你需要一个通用ID和SDK令牌。你的通用ID可以在你的代码段页面通过点击页面中心的“Here you go”链接找到。你的SDK令牌将由Ambassador提供。

Objective-C

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [AmbassadorSDK runWithUniversalToken:<your_sdk_token> universalID:<your_universal_id>];
    return YES;
}

Swift

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
    // Override point for customization after application launch.
    AmbassadorSDK.runWithUniversalToken(<your_sdk_token>, universalID:<your_universal_id>)
    return true
}

用法

有关如何使用SDK的说明,请参阅我们的官方文档

版本说明

1.1.3

Update documentation on SDK Methods
Update tests and CI

1.1.2

Improve the SVC popup timing
Make conversion API call more robust
Improve logs for conversions

1.1.1

Added more robust support for navigation and tab controllers

1.1.0

Improved code to handle JSON responses more gracefully.
Improved error handling on the RAF widget based on the status of the contact provided.
Improved version tracking for future updates.
Deprecated welcome message.
Updated deprecated method IdentifyWithEmail so it no longer sends the email as the UID.
Improved the identify Safari View Controller experience.
Added confirmation that Twitter and Facebook are installed when sharing.

所有版本

Deprecated the Welcome Message feature

1.0.12

Added iOS 11 support
Fixed large close button icon

1.0.11

Add bitcode support for arm64, swift projects

1.0.10

Fix Swift 3.x compatibility issues
Changed safari view controller animation to popover
Refactored callback behavior to fire after view controller closed
Included safari view controller for iOS 9+

从v1.0.9升级

注意:Swift 3.x应用应升级到此版本。

1.0.9

Add optional callback to identify method
Add ability to customize identify landing page time (LandingPageMinimumSeconds)
Made iOS 9 identify functionality consistent with iOS 10
Add better default message for LandingPageMessage

从v1.0.8升级

Note that the Safari View Controller will now show on screen for iOS 9 + for identify calls.

1.0.8(已退役)

Added new method to get referring short code
Added new method to get campaign from short code
Added support for iOS 10
Added customizable landing page for identify

1.0.7(已退役)

Updated identifyWithUserID and trackEvent methods

从v1.0.6升级

The options dictionary was removed from the identifyWithUserID and trackEvent methods. You no longer need to pass this object to these methods.

1.0.6(已退役)

Updated crash analytics
Refactoring and bug fixes

1.0.5(已退役)

Updated some AmbassadorSDK functions to handle more data
Refactoring and minor bug fixes

从v1.0.4升级

Highly recommended to upgrade from any deprecated functions
For more information on installing and implementing AmbassadorSDK check here

下载

Framework.zip