このページはAIにより自動翻訳されており、不正確な内容が含まれている可能性があります。翻訳の誤りを報告するには、ページ右側の目次の下にあるフィードバックをご利用ください。

警告
AppboyKit(OBJECTIVE-C SDKとも呼ばれます)はサポートが終了しており、Swift SDKに置き換えられました。新機能、バグ修正、セキュリティ更新、テクニカルサポートは提供されません。ただし、メッセージングと分析は引き続き通常どおり機能します。詳しくは、新しいBraze Swift SDKの紹介を参照してください。
向きをカスタマイズする
すべてのアプリ内メッセージの向きの設定
すべてのアプリ内メッセージの向きを固定するには、ABKInAppMessageUIControllerのsupportedOrientationMaskプロパティを設定します。アプリがstartWithApiKey:inApplication:withLaunchOptions:を呼び出した後に、次のコードを追加します。
// 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;
// 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プロパティを設定します。
// Set inAppMessage orientation to portrait
inAppMessage.orientation = ABKInAppMessageOrientationPortrait;
// Set inAppMessage orientation to landscape
inAppMessage.orientation = ABKInAppMessageOrientationLandscape;
// Set inAppMessage orientation to portrait
inAppMessage.orientation = ABKInAppMessageOrientation.portrait
// Set inAppMessage orientation to landscape
inAppMessage.orientation = ABKInAppMessageOrientation.landscape
デバイスの向きがアプリ内メッセージのorientationプロパティと一致しない場合、アプリ内メッセージは表示されません。

注
iPadの場合、アプリ内メッセージは、実際の画面の向きに関係なく、ユーザーが希望する向きのスタイルで表示されます。
メソッド宣言
追加情報については、次のヘッダーファイルを参照してください。
New Stuff!