# YAML will be generated after clicking "Generate YAML"
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
import Foundation
import OneSignalFramework
class AppDelegate: UIResponder, UIApplicationDelegate {
static var orientationLock = UIInterfaceOrientationMask.all
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
setup(launchOptions: launchOptions)
return true
}
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return AppDelegate.orientationLock
}
func setup(launchOptions: [UIApplication.LaunchOptionsKey: Any]?) {
OneSignal.initialize("ID", withLaunchOptions: launchOptions)
OneSignal.Notifications.requestPermission({ accepted in }, fallbackToSettings: true)
}
}
// Click "Generate JSON" to create random data
Drop images here or click to upload
PNG, JPG, JPEG • Max 10 images
Upload images to see preview