We constantly publish updates to our documentation, which may not yet be available in your language. For the most current information, use the English version.
// Get pod from repository
pod 'Adjust', '~> 4.38.1'
// Get source directly from GitHub
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.38.1'
アプリでWeb viewを使用している場合は、以下のようにAdjust Web Bridgeを追加します。
pod 'Adjust/WebBridge', '~> 4.38.1'
Carthage
Carthageを使用してSDKを追加するには、以下をCartfileに追加します。
github "adjust/ios_sdk"
Swift Package Manager
Swift Package Managerを使ってSDKを追加するには、以下の手順に従ってください。
-(void)didBecomeActiveWithConversation:(MSConversation *)conversation {
// Called when the extension is about to move from the inactive to active state.
// This will happen when the extension is about to present UI.
// Use this method to configure the extension and restore previously stored state.
[Adjust trackSubsessionStart];
}
-(void)willResignActiveWithConversation:(MSConversation *)conversation {
// Called when the extension is about to move from the active to inactive state.
// This will happen when the user dissmises the extension, changes to a different
// conversation or quits Messages.
// Use this method to release shared resources, save user data, invalidate timers,
// and store enough state information to restore your extension to its current state
// in case it is stopped later.
[Adjust trackSubsessionEnd];
}
Project Navigator上で、View Controllerのソースファイルを開きます。ファイルの最上部にimportのステートメントを追加します。 Web View DelegateのviewDidLoadまたは viewWillAppearメソッドの AdjustBridgeに以下のコールを追加します。
Objective-C
Swift
#import "AdjustBridge.h"
// or #import <AdjustSdkWebBridge/AdjustBridge.h>
- (void)viewWillAppear:(BOOL)animated {
WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds];
// add @property (nonatomic, strong) AdjustBridge *adjustBridge; on your interface
[self.adjustBridge loadWKWebViewBridge:webView];
// optionally you can add a web view delegate so that you can also capture its events
// [self.adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:(id<wknavigationdelegate>)self];
}
// ...