SDK

Implementation

In this page let's dive deeper into how passes are handled in your Cordova app for Android. In order for our library to be able to open passes distributed via a push notification, a link in an email or in a website you need to declare an activity like the one below in your /platforms/android/app/src/main/AndroidManifest.xml:

<activity
    android:name="re.notifica.ui.PassbookActivity"
    android:configChanges="keyboardHidden|orientation|screenSize"
    android:hardwareAccelerated="true">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data
            android:host="push.notifica.re"
            android:pathPrefix="/pass/forapplication/{NOTIFICARE_APP_ID}"
            android:scheme="https" />
    </intent-filter>
</activity>

This will be the only thing needed to use our default UI to handle passes.

You can also request passes by their serial and retrieve the raw pass object:

Notificare.fetchPassWithSerial(serial, function(result) {
  //Handle success
}, function(e) {
  //Handle error
});

If instead you wish to retrieve a pass using its custom barcode, you should use the following method:

Notificare.fetchPassWithBarcode(barcode, function(result) {
  //Handle success
}), function(e) {
  //Handle error
});