• 05-11-2020, 02:40:54
    #1
    Merhabalar, aşağıdaki kodlar sayesinde firestore erişebiliyorum ancak ekleme veya okuma yapmak istediğimde hata alıyorum. Yanlış yaptığım kısmı gösterebilir misiniz? Kodlar ve hatalar aşağıdadır.

    namespace Google\Cloud\Samples\Firestore;
    use Google\Cloud\Firestore\FirestoreClient;
    require 'vendor/autoload.php';
    function initialize()
    {
        $db = new FirestoreClient([
            "projectId" => "phptest-a1810"
            ]);
        printf('Created Cloud Firestore client with default project ID.' . PHP_EOL);
    }
    initialize();
    Erişim tamam ancak aşağıdaki veri ekleme kısmında hata alıyorum

    function add_data($projectId)
    {
        $db = new FirestoreClient([
            'projectId' => $projectId,
        ]);
        $docRef = $db->collection('users')->document('lovelace');
        // users koleksiyonunda lovelace dökümanlarına eklemek istiyorum
        $docRef->set([
            'first' => 'Ada',
            'last' => 'Lovelace',
            'born' => 1815
        ]);
        printf('Added data to the lovelace document in the users collection.' . PHP_EOL);
    }
    $proje='phptest-a1810';
    add_data($proje);
    Fatal error: Uncaught RuntimeException: Credentials fetcher does not implement Google\Auth\UpdateMetadataInterface in C:\AppServ\www\firebase\vendor\google\auth\src\FetchAuthTokenCache.php:190 Stack trace: #0 C:\AppServ\www\firebase\vendor\google\gax\src\CredentialsWrapper.php(197): Google\Auth\FetchAuthTokenCache->updateMetadata(Array, 'https://firesto...') #1 [internal function]: Google\ApiCore\CredentialsWrapper->Google\ApiCore\{closure}(Object(stdClass)) #2 C:\AppServ\www\firebase\vendor\grpc\grpc\src\lib\UnaryCall.php(44): Grpc\Call->startBatch(Array) #3 C:\AppServ\www\firebase\vendor\grpc\grpc\src\lib\BaseStub.php(291): Grpc\UnaryCall->start(Object(Google\Cloud\Firestore\V1\CommitRequest), Array, Array) #4 C:\AppServ\www\firebase\vendor\grpc\grpc\src\lib\BaseStub.php(541): Grpc\BaseStub->Grpc\{closure}('/google.firesto...', Object(Google\Cloud\Firestore\V1\CommitRequest), Array, Array, Array) #5 C:\AppServ\www\firebase\vendor\google\gax\src\Transport\GrpcTransport.php(213): Grpc\BaseStub->_simpleRequest('/google.fir in C:\AppServ\www\firebase\vendor\google\auth\src\FetchAuthTokenCache.php on line 190
  • 05-11-2020, 02:50:23
    #2
    Cevap burada

    https://youtu.be/87bwq4nnruc
  • 05-11-2020, 02:56:26
    #3
    Merhabalar yardımınız için teşekkür ederim ancak bu arkadaş videonun 1. serisinde realtime-database ile başlıyor bana firestore database gerekli ikisi farklı şeyler malesef


    blap adlı üyeden alıntı: mesajı görüntüle
  • 05-11-2020, 03:01:07
    #4
    onurgosteris adlı üyeden alıntı: mesajı görüntüle
    Merhabalar yardımınız için teşekkür ederim ancak bu arkadaş videonun 1. serisinde realtime-database ile başlıyor bana firestore database gerekli ikisi farklı şeyler malesef
    Pardon yanlış link atmışım. Ezbere olmuş doğrusu bu.


    https://youtu.be/GEtUtqtOpXg
  • 05-11-2020, 03:20:41
    #5
    Buradada aynı hatayı döndü malesef

    blap adlı üyeden alıntı: mesajı görüntüle
    Pardon yanlış link atmışım. Ezbere olmuş doğrusu bu.


    https://youtu.be/GEtUtqtOpXg
  • 05-11-2020, 03:23:20
    #6
    onurgosteris adlı üyeden alıntı: mesajı görüntüle
    Buradada aynı hatayı döndü malesef
    Her şeyi sıfırlayıp videonun part 1 kısmını izleyerek sıfırdan tekrar yapar mısınız?