Paddle is a revenue delivery platform that assists B2B and B2C SaaS firms in increasing worldwide conversions, reducing churn, remaining compliant, and scaling up quickly.
The Firebase Realtime Database lets you build rich, collaborative applications by allowing secure access to the database directly from client-side code.
Firebase Realtime Database IntegrationsPaddle + Firebase Realtime Database
Create or Replace Firebase Realtime Database Record to Realtime Database from New Transaction in paddle Read More...Paddle + Firebase Realtime Database
Create or Replace Firebase Realtime Database Record to Realtime Database from New User in paddle Read More...Paddle + Firebase Realtime Database
Create or Replace Firebase Realtime Database Record to Realtime Database from New Payment in paddle Read More...Firebase Realtime Database + Paddle
Create Subscription to paddle from New Child Object in a Firebase Realtime Database in Realtime Database Read More...Firebase Realtime Database + Paddle
Create Coupon to paddle from New Child Object in a Firebase Realtime Database in Realtime Database Read More...It's easy to connect Paddle + Firebase Realtime Database without coding knowledge. Start creating your own business flow.
Trigger when new payment made.
Trigger when new transaction is coming.
Trigger when new user created.
Trigger when One-off purchases new order processing completed. Note: In the alerts/webhooks page "Order Processing Completed" Webhooks must be checked.
Trigger when new One-off purchases payment refunded. Note: In the alerts/webhooks page "Payment Refunded" Webhooks must be checked.
Trigger when new subscription cancelled. Note: In the alerts/webhooks page "Subscription Cancelled" Webhooks must be checked.
Trigger when new subscription created. Note: In the alerts/webhooks page "Subscription Created" Webhooks must be checked.
Trigger when new subscription payment failed. Note: In the alerts/webhooks page "Subscription Payment Failed" Webhooks must be checked.
Trigger when new subscription payment refunded. Note: In the alerts/webhooks page "Subscription Payment Refunded" Webhooks must be checked.
Trigger when new subscription payment success. Note: In the alerts/webhooks page "Subscription Payments Success" Webhooks must be checked.
Trigger when new subscription updated. Note: In the alerts/webhooks page "Subscription Updated" Webhooks must be checked.
Triggers on updation of a child object in firebase realtime database.
New Child Object in a Firebase Realtime Database
Create a new coupon for the given product or a checkout.
Create a new subscription billing plan with the supplied parameters.
Creates or replaces a child object within your Firebase Realtime Database.
(30 seconds)
(10 seconds)
(30 seconds)
(10 seconds)
(2 minutes)
Paddle is a data layer for mobile application which helps to implement the offline-first feature of your app. It has 2 components – Paddle Cloud and Paddle SDK. The Paddle Cloud is a cloud service which allows you to store and sync the data between multiple devices. You can also use it to share data across apps. Whereas, the Paddle SDK is an Android/iOS library which helps to integrate the Paddle Cloud into your app.
Firebase Realtime Database is a NoSQL database from Google. It stores the user data in JSON format and is real time by nature. You don’t have to worry about manually synchronizing the data between devices as Firebase Realtime Database handles it automatically.
In this part, I will show you how to integrate Paddle and Firebase Realtime Database in your Android app. Fplow the steps given below:
Step 1. Create a new project in Android Studio by going to File → New → New Project. Then, fill up the details:
Project Name. BucketListApp
Company Domain. renukaarora.com
Package Name. com.bucketlistapp
Activity Name. MainActivity
Minimum Required SDK. API 19. Android 4.4 (KitKat)
Target SDK Version. API 21. Android 5.0 (Lplipop)
Compile With. Android 5.0 (Lplipop)
Step 2. Now go to File → New → Import Project and select the fplowing options in the dialog box:
Project Name. PaddleCloud-Android-SDK-master
Path. PaddleCloud-Android-SDK-master/samples/android/paddlecloud-android-sdk-master/app/src/main/java/com/paddleplatform/android/sample/bucketlistapp/MainActivity.java
Modify the MainActivity class. Replace the code in onCreate(. with the fplowing code:
if (!PaddleManager.isPaddleInstanceEnabled(). { // Use this method to check if the Paddle instance is enabled or not. Log.i("Paddle", "Paddle instance is disabled"); } else { // Check if there is an active device token available for this app PaddleManager paddleManager = PaddleManager.getInstance(this, getApplicationContext(), BuildConfig.APPLICATION_ID); if (paddleManager != null. { // If there is an active device token available for this app, then create an instance of PaddleRealTimeDatabaseRealmRealm mRealm = new PaddleRealTimeDatabaseRealmRealm(paddleManager, getApplicationContext()); mRealm.start(); } else { // If there is no active device token available for this app then initialize an instance of the PaddleRealTimeDatabaseRealmRealm mRealm = new PaddleRealTimeDatabaseRealmRealm(getApplicationContext(), true); mRealm.start(); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 if ( ! PaddleManager . isPaddleInstanceEnabled ( . . { // Use this method to check if the Paddle instance is enabled or not. Log . i ( "Paddle" , "Paddle instance is disabled" . ; } else { // Check if there is an active device token available for this app PaddleManager paddleManager = PaddleManager . getInstance ( this , getApplicationContext ( . , BuildConfig . APPLICATION_ID . ; if ( paddleManager != null . { // If there is an active device token available for this app, then create an instance of PaddleRealTimeDatabaseRealmRealm mRealm = new PaddleRealTimeDatabaseRealmRealm ( paddleManager , getApplicationContext ( . . ; mRealm . start ( . ; } else { // If there is no active device token available for this app then initialize an instance of the PaddleRealTimeDatabaseRealmRealm mRealm = new PaddleRealTimeDatabaseRealmRealm ( getApplicationContext ( . , true . ; mRealm . start ( . ; } } Now add the fplowing code in onCreate(. . bopean initialized = false; try { initialized = mRealm.init(); Log.i("PADDLE", "initialized to " + initialized); } catch (Exception e. { Log.i("PADDLE", "failed to initialize realm"); } if (!initialized. { // This realm has not been initialized yet, so display the UI to do that String errorMsg = String.format("Unable to initialize realm %s (%s)", getClass(.getSimpleName(), e); Toast toast = Toast.makeText(getApplicationContext(), errorMsg, Toast.LENGTH_SHORT); toast.show(); return; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 bopean initialized = false ; try { initialized = mRealm . init ( . ; Log . i ( "PADDLE" , "initialized to " + initialized . ; } catch ( Exception e . { Log . i ( "PADDLE" , "failed to initialize realm" . ; } if ( ! initialized . { // This realm has not been initialized yet, so display the UI to do that String errorMsg = String . format ( "Unable to initialize realm %s (%s)" , getClass ( . . getSimpleName ( . , e . ; Toast toast = Toast . makeText ( getApplicationContext ( . , errorMsg , Toast . LENGTH_SHORT . ; toast . show ( . ; return ; } Also add the fplowing code in onPause(. . synchronized void onPause(. { super.onPause(); if (!initialized. { // Uninitialized realms stop receiving remote updates, so put your local changes into a queue first synchronized(this. { mLocalQueue = new LocalQueue(this); } } } Finally, add the fplowing code inside onHandleIntent(. . synchronized void onHandleIntent(Intent intent. { if (!initialized. { // Uninitialized realms stop receiving remote updates, so put your local changes into a queue first synchronized(this. { mLocalQueue = new LocalQueue(this); } } updateFromFirebase(intent); } private void updateFromFirebase(Intent intent. { synchronized(this. { mLocalQueue = new LocalQueue(this); // Synchronize with Firebase Realtime Database mLocalQueue.syncWithFirebase(intent); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 synchronized void onHandleIntent ( Intent intent . { if ( ! initialized . { // Uninitialized realms stop receiving remote updates, so put your local changes into a queue first synchronized ( this . { mLocalQueue = new LocalQueue ( this . ; } } updateFromFirebase ( intent . ; } private void updateFromFirebase ( Intent intent . { synchronized ( this . { mLocalQueue = new LocalQueue ( this . ; // Synchronize with Firebase Realtime Database mLocalQueue . syncWithFirebase ( intent . ; } } Next, add the fplowing code in LocalQueue class. public class LocalQueue implements Queue<DataItem> { private final Realm mRealm; private final BaseListener<DataItem> listener; public LocalQueue(Context context. { mRealm = RealmFactory.createDefaultInstance(context); listener = new BaseListener<DataItem>(. { @Override public void onDataChanged(DataItem dataItem. { updateFromFirebase(dataItem); } @Override public void onCancelledUpdateFromFirebase(. {} }; } public void syncWithFirebase(DataItem item. { mRealm.copyToAsync((DataSnapshot. item); } public synchronized void deleteAllSnapshots(. { deleteAllSnapshotsInBackground(); } public synchronized void deleteAllSnapshotsInBackground(. { realm(.deleteAllAsync(); } public synchronized int getSize(. { return realm(.where(DATA_TYPE.equalTo("id", 0.findAll(.size(); } public synchronized DataItem getFirst(. throws Exception { return realm(.where(DATA_TYPE.equalTo("
The process to integrate Paddle and Firebase Realtime Database may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.