toobay Flutter Tutorials In this guide, we will explain how to Implement Consumables Non-Consumables and Subscriptions using the in_app_purchase plugin in your flutter App. 1- Add these permissions to android/app/src/main/AndroidManifest.xml <uses-permission android :name ="com.android.vending.BILLING" /> <uses-permission android :name ="android.permission.INTERNET" /> 2- Make sure you are using your own product IDs. 3- Add these to your package’s pubspec.yaml file: in_app_purchase : ^1.0.9 provider : ^6.0.1 shared_preferences : ^2.0.8 NOTE : If you want to use in_app_purchase 2.0.0 version or above follow the below instructions. # Rename in_app_purchase_ios to in_app_purchase_storekit. # Rename InAppPurchaseIosPlatform to InAppPurchaseStoreKitPlatform. # Rename InAppPurchaseIosPlatformAddition to InAppPurchaseStoreKitPlatformAddition. This is our file: main.dart import 'package:flutter/foundation.dart' ; import 'package:flutter/material...
How to add In-App Purchase subscription in Flutter. toobay Flutter Tutorials In this tutorial we will teach you how to implement subscription in your app. For this we will use the in app purchases package. In addition we will have to create a product ID for subscription in our Google Play Console which we will use in our project. 1- Add these permissions to android/app/src/main/AndroidManifest.xml 1 2 <uses-permission android:name="com.android.vending.BILLING" /> <uses-permission android:name="android.permission.INTERNET"/> 2- Add this line in the dependencies block android/app/build.gradle inside dependencies block dependencies { implementation 'com.android.billingclient:billing:3.0.2' } 3- Make sure you are using your own product ID 4- Add this to your package’s pubspec.yaml file: 1 in_app_purchase: ^0.5.2 This is our file: main.dart 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 ...
The native ad is that matches our website theme where we can change the color and font according to our website. Here we will implement it with templates which you can also use in your application. Add the Google Mobile Ads plugin as a dependency to the pubspec.yaml file. /pubspec.yaml google_mobile_ads : ^1.0.1 AdMob app ID Add the Highlighted lines to the AndroidManifest.xml file with your own AdMob app ID. android/app/src/main/AndroidManifest.xml <manifest> ... <application> ... <meta-data android:name = "com.google.android.gms.ads.APPLICATION_ID" android:value = " ca-app-pub-3940256099942544~3347511713 " /> </application> </manifest> Change minSdkVersion to 19 android/app/build.gradle defaultConfig { // TODO: Specify your own uni...