I'm using back4app and there documention socks... this was working fine two weeks ago, i lost my build and have had to rebuild my project from scratch, there doumention is missing replaced with errors or links to other usless info... and i can not get my app to recieve notifications at all! Ok rant aside heres what i have, Permisions and notifications done, and code below (app deligate) - My APP & Client ID (hidden from the forums.
import UIKit
import Parse
import UserNotifications
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let configuration = ParseClientConfiguration {
$0.applicationId = "Hidden"
$0.clientKey = "Hidden"
$0.server = "https:/
}
Parse.initialize(with: configuration)
saveInstallationObject()
registerForPushNotifications()
return true
}
func registerForPushNotifications() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) {
(granted, error) in
print("Permission granted: \(granted)")
}
}
func applicationWillResignActive(_ application: UIApplication) {
/
/
}
func applicationDidEnterBackground(_ application: UIApplication) {
/
/
}
func applicationWillEnterForeground(_ application: UIApplication) {
/
}
func applicationDidBecomeActive(_ application: UIApplication) {
/
}
func applicationWillTerminate(_ application: UIApplication) {
/
}
func saveInstallationObject(){
if let installation = PFInstallation.current(){
installation.saveInBackground {
(success: Bool, error: Error?) in
if (success) {
print("You have successfully connected your app to Back4App!")
} else {
if let myError = error{
print(myError.localizedDescription)
}else{
print("Uknown error")
}
}
}
}
}
}