Fovea / cordova-plugin-purchase-demo

Demo of the Purchase Plugin for Cordova
32 stars 35 forks source link

Running The Purchase Demo results in errors #4

Closed mrweix closed 6 years ago

mrweix commented 9 years ago

Compiling the code with Phonegap 3.6.0-0.21.19 and running the Demo code in Xcode 6.4 I get the following errors

in app.initStore = function() { I get

  Uncaught ReferenceError: device is not defined

If I comment that part I get down until here, then the next error

    console-via-logger.js:173 onDeviceReady
    console-via-logger.js:173 initStore
    console-via-logger.js:173 {"verbosity":0,"FREE_SUBSCRIPTION":"free    subscription","PAID_SUBSCRIPTION":"paid subscription","CONSUMABLE":"consumable","NON_CONSUMABLE":"non consumable","ERR_SETUP":6777001,"ERR_LOAD":6777002,"ERR_PURCHASE":6777003,"ERR_LOAD_RECEIPTS":6777004,"ERR_CLIENT_INVALID":6777005,"ERR_PAYMENT_CANCELLED":6777006,"ERR_PAYMENT_INVALID":6777007,"ERR_PAYMENT_NOT_ALLOWED":6777008,"ERR_UNKNOWN":6777010,"ERR_REFRESH_RECEIPTS":6777011,"ERR_INVALID_PRODUCT_ID":6777012,"ERR_FINISH":6777013,"ERR_COMMUNICATION":6777014,"ERR_SUBSCRIPTIONS_NOT_AVAILABLE":6777015,"ERR_MISSING_TOKEN":6777016,"ERR_VERIFICATION_FAILED":6777017,"ERR_BAD_RESPONSE":6777018,"ERR_REFRESH":6777019,"ERR_PAYMENT_EXPIRED":6777020,"REGISTERED":"registered","INVALID":"invalid","VALID":"valid","REQUESTED":"requested","INITIATED":"initiated","APPROVED":"approved","FINISHED":"finished","OWNED":"owned","QUIET":0,"ERROR":1,"WARNING":2,"INFO":3,"DEBUG":4,"INVALID_PAYLOAD":6778001,"CONNECTION_FAILED":6778002,"PURCHASE_EXPIRED":6778003,"validator":null,"log":{},"products":[],"_queries":{"callbacks":{"byQuery":{"refreshed":[{}],"requested":[{}],"finished":[{}],"owned":[{}],"registered":[{}],"expired":[{},{}],"re-refreshed":[{}]}}},"utils":{}}
     console-via-logger.js:173 Object {verbosity: 0, FREE_SUBSCRIPTION: "free subscription", PAID_SUBSCRIPTION: "paid subscription", CONSUMABLE: "consumable", NON_CONSUMABLE: "non consumable"…}APPROVED: "approved"CONNECTION_FAILED: 6778002CONSUMABLE: "consumable"DEBUG: 4ERROR: 1ERR_BAD_RESPONSE: 6777018ERR_CLIENT_INVALID: 6777005ERR_COMMUNICATION: 6777014ERR_FINISH: 6777013ERR_INVALID_PRODUCT_ID: 6777012ERR_LOAD: 6777002ERR_LOAD_RECEIPTS: 6777004ERR_MISSING_TOKEN: 6777016ERR_PAYMENT_CANCELLED: 6777006ERR_PAYMENT_EXPIRED: 6777020ERR_PAYMENT_INVALID: 6777007ERR_PAYMENT_NOT_ALLOWED: 6777008ERR_PURCHASE: 6777003ERR_REFRESH: 6777019ERR_REFRESH_RECEIPTS: 6777011ERR_SETUP: 6777001ERR_SUBSCRIPTIONS_NOT_AVAILABLE: 6777015ERR_UNKNOWN: 6777010ERR_VERIFICATION_FAILED: 6777017Error: (options)FINISHED: "finished"FREE_SUBSCRIPTION: "free subscription"INFO: 3INITIATED: "initiated"INVALID: "invalid"INVALID_PAYLOAD: 6778001NON_CONSUMABLE: "non consumable"OWNED: "owned"PAID_SUBSCRIPTION: "paid subscription"PURCHASE_EXPIRED: 6778003Product: (options)QUIET: 0REGISTERED: "registered"REQUESTED: "requested"VALID: "valid"WARNING: 2_prepareForValidation: (product, callback)_queries: Object_refreshForValidation: (callback)_validator: (product, callback, isPrepared)error: (cb, altCb)get: (id)log: Objectoff: (callback)once: (query, action, callback)order: (pid)products: Array[5]ready: (cb)refresh: ()register: (product)trigger: (product, action, args)utils: Objectvalidator: "https://api.fovea.cc:1982/check-purchase"verbosity: 4when: (query, once, callback)__proto__: Object
     console-via-logger.js:173 Store available
     console-via-logger.js:173 registerProducts
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'consumable1 registered'
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'extra life registered'
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'consumable registered'
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'registered'
     console-via-logger.js:173 [store.js] DEBUG: ios -> product consumable1 registered
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'consumable1 updated'
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'extra life updated'
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'consumable updated'
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'updated'
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'nonconsumable1 registered'
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'full version registered'
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'non consumable registered'
     console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'registered'
    console-via-logger.js:173 [store.js] DEBUG: ios -> product nonconsumable1 registered
    console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'nonconsumable1 updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'full version updated'
   console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'non consumable updated'
   console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'subscription1 registered'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'paid subscription registered'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'subscription registered'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'registered'
  console-via-logger.js:173 [store.js] DEBUG: ios -> product subscription1 registered
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'subscription1 updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'paid subscription updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'subscription updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'nonconsumablenonhosted1 registered'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'non-hosted content download registered'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'non consumable registered'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'registered'
  console-via-logger.js:173 [store.js] DEBUG: ios -> product nonconsumablenonhosted1 registered
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'nonconsumablenonhosted1 updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'non-hosted content download updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'non consumable updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'nonconsumablehosted1 registered'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'hosted content download registered'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'non consumable registered'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'registered'
  console-via-logger.js:173 [store.js] DEBUG: ios -> product nonconsumablehosted1 registered
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'nonconsumablehosted1 updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'hosted content download updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'non consumable updated'
  console-via-logger.js:173 [store.js] DEBUG: store.queries !! 'updated'
  console-via-logger.js:173 5
  console-via-logger.js:173 [store.js] DEBUG: queries ++ 'updated'
  console-via-logger.js:173 [store.js] DEBUG: queries ++ 'subscription1 approved'
  console-via-logger.js:173 [store.js] DEBUG: queries ++ 'subscription1 verified'
  console-via-logger.js:173 [store.js] DEBUG: queries ++ 'subscription1 unverified'
  console-via-logger.js:173 [store.js] DEBUG: queries ++ 'subscription1 updated'
  console-via-logger.js:173 6
  console-via-logger.js:173 [store.js] DEBUG: queries ++ 'extra life approved'
  console-via-logger.js:173 7
  console-via-logger.js:173 [store.js] DEBUG: queries ++ 'full version approved'
  console-via-logger.js:173 [store.js] DEBUG: queries ++ 'full version updated'
  console-via-logger.js:173 8
  console-via-logger.js:173 [store.js] DEBUG: queries ++ 'hosted content download approved'
  console-via-logger.js:173 9
  index.js:181 Uncaught TypeError: store.when(...).downloading is not a function

What am I missing? Any ideas? Thanks!

drago-aca commented 9 years ago

try to add manual plugins with cordova plugin add xxx

mrweix commented 9 years ago

thats what I did, added the plugins manually. Did anybody get this to work?

j3k0 commented 6 years ago

2 years old issue. Hope you got it solved since then! Closing.