0

I want to integrate my app through firebase I follow this : https://firebase.google.com/docs/invites/ios but it shows me error of user must be sign in.

AppDeleget :

@available(iOS 9.0, *)
    func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
        return self.application(application, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: "")
    }

    internal func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {


        if GIDSignIn.sharedInstance().handle(url, sourceApplication: sourceApplication, annotation: annotation) {
            return true
        }

        return Invites.handleUniversalLink(url) { invite, error in
            // ...
        }

         return FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
    }

My InviteVC

@IBAction func BtnActionInvtation(_ sender: Any) {

    if let invite = Invites.inviteDialog() {
        invite.setInviteDelegate(self)

        invite.setMessage("Try this app")
        // Title for the dialog, this is what the user sees before sending the invites.
        invite.setTitle("Invites Example")
        invite.setDeepLink("app_url")
        invite.setCallToActionText("Install!")
        invite.setCustomImage("https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png")
        invite.open()
    }

}
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Prasann
  • 135
  • 1
  • 9

2 Answers2

2

Change the rules in Firebase database rules if you are not asking user to sign in

{
  "rules": {
    ".read": "true",
    ".write": "auth != null"
  }
}
Pang
  • 9,564
  • 146
  • 81
  • 122
Yogesh Tandel
  • 1,738
  • 1
  • 19
  • 25
0

Firebase has clearly explained all the steps to integrate FirebaseInvites in iOS. https://firebase.google.com/docs/invites/

I think you don't read their documentation clearly. THey have mentioned you must sign in with Google account to invites your friends using FirebaseInvites.

If you need any help, please let me know.

Thanks!

nitin.agam
  • 1,949
  • 1
  • 17
  • 24