Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var gcVerifier = require("gamecenter-identity-verifier")
  2. var identity = {"signature":"ZGc0qwJwgBw6XTnFehOC72k/LVJp4VR7CepPOhYHcS3OxqpvVlBFiKsl/HowE6hcNP0tn/uC/pasHQof3W+vjTXjoCQZk8n+LC0U+32FkaLi0rzC9vZ6Hkr2GQVGFhkPecUbG+YEiFVvj3XAqvg+/6xcSTF0FqVQ/udEpzofHofNxk6kPmZIzhEYOVudslRloyDO4DaIFGx1XCLlZco8c1NEVVZxal1xADk5RIjgTY123Lj59CwJa1ma8tXQQ/QWqcDIgjGqggYuhBhtNlJj1SX4hl7Lpvya/JwdjNV69dxkSNaQzogQX+EmN2NMtCw67X3MdPQ2y1pXoIm8jIwYJA==","publicKeyUrl":"https://static.gc.apple.com/public-key/gc-prod-4.cer","timestamp":"1556010428749","playerId":"G:1323375045","salt":"Zs5Blg==", "bundleId":"net.tests.numbako"}
  3.  
  4. var verifier = new Promise(function(resolve, reject) {
  5.     gcVerifier.verify(identity, function (err, token) {
  6.       if (!err) {
  7.         resolve(token);
  8.       }
  9.       else {
  10.         reject();
  11.       }
  12.     });
  13. });
  14.  
  15. async function waitVerification() {
  16.     const res = await verifier.then(function(data) {
  17.         return data;
  18.     }).catch(function() {return "21321"});
  19.     return res;
  20. }
  21.  
  22. const verificationResult = await waitVerification();
  23. console.log(verificationResult);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement