Giter VIP home page Giter VIP logo

phonegap-barcode-push-study's Introduction

Phonegap - Barcode and Push

Referências

Instruções

Push Notification

  1. Sadastrar um projeto no Google Developers Console
  2. Pegar informações de senderID, e API KEY do GCM (Google Cloud Messaging)
  3. Após o registro do push é necessário salvar o registrationId do device em um banco a ser utilizado quando os notifications forem enviados.
  4. https://developers.google.com/mobile/add?platform=ios para cadastrar o certificado p12

Shell:

phonegap plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"

config.xml (phonegap builder):

<preference name="android-build-tool" value="gradle" />
<plugin name="phonegap-plugin-push" source="npm">
    <param name="SENDER_ID" value="XXXXXXX" />
</plugin>

Exemplo de utilização

var push = PushNotification.init({
    "android": {
        "senderID": "XXXXXXX"
    },
    "ios": {
        "senderID"  : "XXXXXXX",
        "alert"     : true,
        "sound"     : true,
        "gcmSandbox": true
    }
});

push.on('registration', function(data) {
    var texto = document.getElementById("texto");
    texto.innerHTML = data.registrationId;
    console.log(data.registrationId);
});

Barcode Scanner

Shell:

phonegap plugin add phonegap-plugin-barcodescanner

config.xml (phonegap builder):

<plugin name="phonegap-plugin-barcodescanner" spec="4.1.0"/>

Exemplo de utilização

cordova.plugins.barcodeScanner.scan(
  function (result) {
      alert("We got a barcode\n" +
            "Result: " + result.text + "\n" +
            "Format: " + result.format + "\n" +
            "Cancelled: " + result.cancelled);
  },
  function (error) {
      alert("Scanning failed: " + error);
  }
);

Cordova Whitelist

Proporcionou a utilização de ajax para servidor externo

<access origin="*"/>

phonegap-barcode-push-study's People

Contributors

rodrigodemelo avatar

Watchers

James Cloos avatar Rodrigo de Melo Lima avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.