Possible Unhandled Promise Rejection (id:1)

Viewed 273

I was trying to use the Google API auth from expo in react native and when I trying to log to the api , I getting the next error :

code :

import React, { createContext,useContext } from 'react'
import * as Google from 'expo-google-app-auth';


const AuthContext = createContext({})


const config = {
    androidClientId : 'APIKey',
    iosClientId: 'APIKey',
    scope: ["profile", "email"],
    premissions : ["public_profile", "email","gender","location"],
}

export const AuthProvider = ({ children }) => {
    
    const signInWithGoogle = async() => {
        Google.logInAsync(config).then(async (logInResults) => {
            if (logInResults.type === 'success') {
                // login...
          }
        });
    };

  return (
    <AuthContext.Provider
     value={{
        user:null,
        signInWithGoogle
    }}
    >
      {children}
    </AuthContext.Provider>
  )
}

export default function useAuth (){
    return useContext(AuthContext)
}

error :

enter image description here

and this command :

[Unhandled promise rejection: Error: The method or property expo-app-auth.authAsync is not available on ios, are you sure you've linked all the native dependencies properly?]

0 Answers
Related