warning:
AppboyKit(Objective-C SDKとも呼ばれます)はもはやサポートされておらず、Swift SDK. 新しい機能、バグ修正、セキュリティー更新s、またはテクニカルサポートを受けません。ただし、メッセージングと分析は通常どおり機能し続けます。詳しくは、新しいBrazeの概要SDK]を参照してください。
方向のカスタマイズ
すべてのアプリ内メッセージの向きの設定
すべてのアプリ内メッセージの向きを固定するには、ABKInAppMessageUIController で supportedOrientationMask プロパティを設定します。アプリが startWithApiKey:inApplication:withLaunchOptions: を呼び出した後に、次のコードを追加します。
1
2
3
4
// Set fixed in-app message orientation to portrait.
// Use UIInterfaceOrientationMaskLandscape to display in-app messages in landscape
id<ABKInAppMessageUIControlling> inAppMessageUIController = [Appboy sharedInstance].inAppMessageController.inAppMessageUIController;
((ABKInAppMessageUIController *)inAppMessageUIController).supportedOrientationMask = UIInterfaceOrientationMaskPortrait;
1
2
3
4
5
// Set fixed in-app message orientation to portrait
// Use .landscape to display in-app messages in landscape
if let controller = Appboy.sharedInstance()?.inAppMessageController.inAppMessageUIController as? ABKInAppMessageUIController {
controller.supportedOrientationMask = .portrait
}
その後、すべてのアプリ内メッセージは、デバイスの向きに関係なく、サポートされている向きで表示されます。メッセージを表示するには、デバイスの向きがアプリ内メッセージの orientation プロパティでもサポートされている必要があることに注意してください。
アプリ内メッセージごとの向きの設定
または、メッセージごとに方向を設定することもできます。これを行うには、アプリ内メッセージデリゲートを設定します。次に、beforeInAppMessageDisplayed: デリゲートメソッドで、ABKInAppMessage の orientation プロパティを設定します。
1
2
3
4
5
// Set inAppMessage orientation to portrait
inAppMessage.orientation = ABKInAppMessageOrientationPortrait;
// Set inAppMessage orientation to landscape
inAppMessage.orientation = ABKInAppMessageOrientationLandscape;
1
2
3
4
5
// Set inAppMessage orientation to portrait
inAppMessage.orientation = ABKInAppMessageOrientation.portrait
// Set inAppMessage orientation to landscape
inAppMessage.orientation = ABKInAppMessageOrientation.landscape
orientation デバイスの向きがアプリ内メッセージのプロパティと一致しない場合、アプリ内メッセージは表示されません。
note:
iPad の場合、アプリ内メッセージは、実際の画面の向きに関係なく、ユーザーが希望する向きのスタイルで表示されます。
メソッド宣言
追加情報については、次のヘッダーファイルを参照してください。
New Stuff!
GitHub でこのページを編集