Guardian .enroll(forDomain: "{yourTenantDomain}", usingUri: "{enrollmentUri}", notificationToken: "{apnsToken}", signingKey: signingKey, verificationKey: verificationKey ) .start { result in switch result { case .success(let enrolledDevice): // success, we have the enrollment device data available case .failure(let cause): // something failed, check cause to see what went wrong } }
Guardian .authentication(forDomain: "{yourTenantDomain}", device: device) .allow(notification: notification) .start { result in switch result { case .success: // the auth request was successfuly allowed case .failure(let cause): // something failed, check cause to see what went wrong } }
Guardian .authentication(forDomain: "{yourTenantDomain}", device: device) .reject(notification: notification) // or reject(notification: notification, withReason: "hacked") .start { result in switch result { case .success: // the auth request was successfuly rejected case .failure(let cause): // something failed, check cause to see what went wrong } }
Guardian .api(forDomain: "{yourTenantDomain}") .device(forEnrollmentId: "{userEnrollmentId}", token: "{enrollmentDeviceToken}") .delete() .start { result in switch result { case .success: // success, the enrollment was deleted case .failure(let cause): // something failed, check cause to see what went wrong } }