ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • EXPO푸시알람 구현하기(1)
    React-Native/Expo앱만들기 2021. 12. 15. 00:15
    728x90
    <br />
    <b>Fatal error</b>:  Uncaught ExponentPhpSDK\Exceptions\UnexpectedResponseException: Unexpected response was received from Expo API. in \vendor\alymosul\exponent-server-sdk-php\lib\Expo.php:220
    Stack trace:
    #0 vendor\alymosul\exponent-server-sdk-php\lib\Expo.php(120): ExponentPhpSDK\Expo-&gt;executeCurl()
    #1 Api\User\Login.php(65): ExponentPhpSDK\Expo-&gt;notify()
    #2 {main}
      thrown in <b>\vendor\alymosul\exponent-server-sdk-php\lib\Expo.php</b> on line <b>220</b><br />

    위 해당글을 아무리 구글링해도 답이 안나왔지만, 원인을 나는 분석했다 일딴 내가 순수 expo서버에 curl로 post로 보낼때도 같은 에러가 발생하여서 찾아보니

    php에서 expo푸시알람 sdk를 설치해서 사용하는 과정에서 expo api 서버가 정상적으로 응답하지 않는 에러 발생
    cURL Error #:error setting certificate verify locations:
    해결은 curl SSL인증서를 달아줘야됨.

    php.ini에서
    [curl]

    curl.cainfo ="C:/Program Files/iis express/PHP/v7.4/내사이트.cert.pem파일"

    [openssl]

    openssl.cafile="C:/Program Files/iis express/PHP/v7.4/내사이트.cert.pem파일"

    이렇게 설정 해줬는데도 에러남 ㅅㅂ

    https://curl.se/docs/caextract.html
    이거 다운받아서 
    php.ini에

    [curl]
    ; A default value for the CURLOPT_CAINFO option. This is required to be an
    ; absolute path.
    curl.cainfo ="C:/Program Files/iis express/PHP/v7.4/extras/ssl/cacert.pem"

    [openssl]
    ; The location of a Certificate Authority (CA) file on the local filesystem
    ; to use when verifying the identity of SSL/TLS peers. Most users should
    ; not specify a value for this directive as PHP will attempt to use the
    ; OS-managed cert stores in its absence. If specified, this value may still
    ; be overridden on a per-stream basis via the "cafile" SSL stream context
    ; option.
    openssl.cafile="C:/Program Files/iis express/PHP/v7.4/extras/ssl/cacert.pem"

    이렇게 넣어주니까 됨!!!

     

     

    주말에 싹 정리해서 조진다!
    728x90
Designed by Tistory.