I managed to add to services in my app (Create Excel file - Create PDF file)
In both services I had a problem with open file packages..
Packages I used:
open_document 1.0.5
open_filex: ^4.1.1
open_file: ^3.2.1
I used many packages for that purpose, but I think there is a problem I didn't catch it by adding scripts in (AndroidManifest.xml) file, build.gradle (project level).
I will show you my code.
By the way, I'm using GetX package, so there is the Controller class:
import 'dart:io';
import 'dart:typed_data';
import 'package:get/get.dart';
import 'package:open_document/open_document.dart';
import 'package:path_provider/path_provider.dart';
import 'package:uuid/uuid.dart';
import '../model/bill_model.dart';
import 'package:pdf/pdf.dart';
import 'package:pdf/widgets.dart' as pw;
class BillController extends GetxController {
static BillController instance = BillController();
List<String> options = ['Cleaning Tax', 'Running Costs', 'Delay Tax'];
List<BillModel> taxOptions = [
BillModel(id: const Uuid().v1(), name: 'Cleaning Tax'),
BillModel(id: const Uuid().v1(), name: 'Running Costs'),
BillModel(id: const Uuid().v1(), name: 'Delay Tax'),
];
List<BillModel> selectedOptions = [];
Future<Uint8List> createPDF() async {
final pdf = pw.Document();
pdf.addPage(
pw.Page(
build: (context) {
return pw.Center(
child: pw.Text('Hello World'),
);
},
),
);
update();
return pdf.save();
}
Future savePdfFile(String fileName, Uint8List byteList) async {
final output = await getTemporaryDirectory();
var filePath = '${output.path}/$fileName.pdf';
final file = File(filePath);
await file.writeAsBytes(byteList);
await OpenDocument.openDocument(filePath: filePath);
update();
}
}
And here is where I call it in the UI class:
GetBuilder<BillController>(
builder: (controller) => Padding(
padding: EdgeInsets.only(top: Dimensions.height80),
child: AddSaveButton(
title: 'Create bill',
fontSize: Dimensions.font24,
onPress: () async {
final data = await controller.createPDF();
controller.savePdfFile('invoice_5', data);
},
),
),
),
I faced this problem:
Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
and got a solution form this link in StackOverFlow Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
After that got new problem : app:processDebugResources and got the acceptable answer in StackOverFlow too in this link: Execution failed for task ':app:processDebugResources' in Flutter project
my AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.water_collection">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.open_document_example.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths" />
</provider>
<application
android:label="Water collection"
android:name="${applicationName}"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Finally nothing had improved, but still didn't know why?!!
Any help will be appreciated.
Finally after a week of searching, I have got a solution..
All what I did was correct, but the problem was in the "Open file" packages..
All packages I used have problems.
At the end I use a package called open_file_plus and every thing worked fine.
I got some information from this URL: Open file by default application flutter
Related
I am trying to use CapacitorSQLite with capacitor 3. When I call SQLite.requestPermission() its not showing any dialog box asking for permission and the code seems to be never returning from that call as I can see logs before that call but not after.
code look like
async init(): Promise<void> {
if (this.platform.is('android')) {
try {
const sqlite:any = CapacitorSQLite;
console.log('setting permission handler');
this.handlerPermissions = sqlite.addListener(
'androidPermissionsRequest', async (data:any) => {
if (data.permissionGranted === 1) {
console.log('Perm granted');
this.setupDatabase();
} else {
console.log("Permission not granted");
}
});
console.log('REQUESTING PERMS');
await sqlite.requestPermissions();
} catch (e) {
console.log('error on perm req',e);
const alert = await this.alertCtrl.create({
header: 'No DB access',
message: e.message,
buttons: ['OK']
});
await alert.present();
}
} else {
console.log('not running on android platform');
const alert = await this.alertCtrl.create({
header: 'Not android',
message: this.platform.platforms()[0],
buttons: ['OK']
});
await alert.present();
this.setupDatabase();
}
}
can see the following logs
'setting permission handler'
'REQUESTING PERMS'
but am also expecting one of the following as well
'Perm granted'
"Permission not granted"
'error on perm req'
here's AndroidManifest.xml
<?xml version='1.0' encoding='utf-8'?>
<manifest package="io.ionic.starter" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="#mipmap/ic_launcher" android:label="#string/app_name" android:roundIcon="#mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="#style/AppTheme" android:usesCleartextTraffic="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="#string/title_activity_main" android:launchMode="singleTask" android:name="io.ionic.starter.MainActivity" android:theme="#style/AppTheme.NoActionBarLaunch">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/file_paths" />
</provider>
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Am I missing anything? Capacitor doc says plug will have user-permission that need to be added but couldn't see any for sqlite.
Thanks a lot
You do not need specific permissions for this plugin. Check the documentation for examples of how to use this plugin in Angular, React or Vue depends on what you need.
I'm trying to run a basic API call in Flutter using PHP and a MySQL database, but I'm receiving an error which reads:
E/flutter ( 7461): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform
What I've Tried
I have tried the solution proposed here: Bad state: Insecure HTTP is not allowed by platform:
and here: https://www.programmersought.com/article/49295775092/
Sample Code
home.dart
import 'package:flutter/material.dart';
import 'package:flutter_crud/env.sample.dart';
import 'dart:convert';
import 'package:http/http.dart';
class Home extends StatefulWidget {
#override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
void getData() async{
Response response = await get(Uri.parse("${Env.URL_PREFIX}/list"));
Map data = jsonDecode(response.body);
print(data);
}
#override
void initState() {
super.initState();
getData();
}
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Flutter CRUD API'),
centerTitle: true,
),
body:Center(
child: Text('Hello'),
)
);
}
}
The URI prefix comes from env.sample.dart:
class Env{
static String URL_PREFIX = "http://[my.IP.address.here]/flutter_crud";
}
In the debug/AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jacobcollinsdev.flutter_crud">
<uses-permission android:name="android.permission.INTERNET"/>
<application android:usesCleartextTraffic="true"/>
</manifest>
In the main/AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jacobcollinsdev.flutter_crud">
<uses-permission android:name="android.permission.INTERNET" /> <------- I added this line
<application
android:label="flutter_crud"
android:icon="#mipmap/ic_launcher"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="#xml/network_security_config"> <------ I added this line
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<uses-library
android:name="org.apache.http.legacy"
android:required="false" /> <-------I added this code block
</application>
</manifest>
Finally, I have also created this file in android/app/main/res/xml/network_security_config.xml:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config clearTextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
So far nothing has resolved the error and I'm all out of ideas. Any feedback would be grand!
simply these lines in
android/app/src/main/AndroidManifest.xml
1). Add <uses-permission android:name="android.permission.INTERNET" />
before application tag
2). Add android:usesCleartextTraffic="true" inside application tag
You should try loading your images from a SSL certificate domain. That is using HTTPS rather than HTTP.
So for your case, replace "http://[my.IP.address.here]/flutter_crud" to use https://.
remove This
class Env{
static String URL_PREFIX = "http://[my.IP.address.here]/flutter_crud";
}
add this
class Env{
static String URL_PREFIX = "https://[my.IP.address.here]/flutter_crud";
}
use https://
instead of http://
I am trying the push notification for the first time. I followed a tutorial. After running the code, I send a test push notification from Firebase. The notification is appearing in the console log but its not coming in the notification pane.
My code is as follows:
RemotePushNotification.js
import React, { useEffect } from 'react'
import PushNotification from 'react-native-push-notification'
const RemotePushController = () => {
useEffect(() => {
PushNotification.configure({
// (optional) Called when Token is generated (iOS and Android)
onRegister: function (token) {
console.log('TOKEN:', token)
},
// (required) Called when a remote or local notification is opened or received
onNotification: function (notification) {
console.log('REMOTE NOTIFICATION ==>', notification)
})
// process the notification here
},
// Android only: GCM or FCM Sender ID
senderID: '############',
popInitialNotification: true,
requestPermissions: true
})
}, [])
return null
}
export default RemotePushController
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app3">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
<!-- < Only if you're using GCM or localNotificationSchedule() > -->
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name"
android:value="YOUR NOTIFICATION CHANNEL NAME"/>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description"
android:value="YOUR NOTIFICATION CHANNEL DESCRIPTION"/>
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="#android:color/white"/>
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
This is the console log
REMOTE NOTIFICATION ==> {"channelId": "fcm_fallback_notification_channel", "color": null, "data": {}, "finish": [Function finish], "foreground": true, "id": "1987265985", "message": "fwafwaawf", "priority": "high", "sound": null, "tag": "campaign_collapse_key_4557183047135736330", "title": "fawfaf", "userInteraction": false, "visibility": "private"}
I believe you have to create a channel management for android.
https://github.com/zo0r/react-native-push-notification#channel-management-android.
Go through above link you will get to know since few months back they have updated it
Add below line in I am trying the push notification for the first time. I followed a tutorial. After running the code, I send a test push notification from Firebase. The notification is appearing in the console log but its not coming in the notification pane.
My code is as follows: AndroidManifest.xml
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="#string/default_notification_channel_id" />
Hopefully you will receive notification
Currently I'm trying to add a flutter app to my android app but when I try to do an Intent the app crashes and prints the following issue:
I followed this guide here
I get this error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testappandroid/io.flutter.embedding.android.FlutterActivity}: java.lang.IllegalStateException: ensureInitializationComplete must be called after startInitialization
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: ensureInitializationComplete must be called after startInitialization
at io.flutter.view.FlutterMain.ensureInitializationComplete(FlutterMain.java:168)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.initializeFlutter(FlutterActivityAndFragmentDelegate.java:177)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:140)
at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:399)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
So it says: ensureInitializationComplete must be called after startInitialization. One solution is to call FlutterMain.startInitialization(this) in the Flutter Activity. But this isn't working for me:
My Flutter Activity:
public class MainActivity extends FlutterActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
FlutterMain.startInitialization(this);
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
My android app AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.testappandroid">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="io.flutter.embedding.android.FlutterActivity"
android:theme="#style/AppTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<meta-data
android:name="io.flutter.Entrypoint"
android:value="main"
/>
</activity>
</application>
</manifest>
My flutter module AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testappflutter.host">
<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="testappflutter"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
With this line of code I try to open the FlutterActivtiy. This is calling the main() function in my dart code:
Intent defaultFlutter = createDefaultIntent(activity);
activity.startActivity(defaultFlutter);
The code above should start this:
void main() => runApp(MaterialApp(
routes: {
"/": (context) => TestWidget()
}
));
So I followed step by step the guide for adding Flutter to an existing android app. Do I forget something? In my mind maybe the AndroidManifest of the flutter app needs some changes? Any ideas what I'm doing wrong?
insure that you import the right packages:
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
instead of
import io.flutter.app.FlutterActivity
in your MainActivity so your Main activity should look like this:
package com.example.example
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
class MainActivity: FlutterActivity() {
}
FlutterMain.startInitialization(this);
Add This Line Before Super.Create like
FlutterMain.startInitialization(this) //Added line
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
Despite the message ensureInitializationComplete must be called after startInitialization, it is not required to call it. Run Flutter activity this way:
FlutterMain.startInitialization(context)
startActivity(FlutterActivity.createDefaultIntent(context))
If you get the crash NoClassDefFoundError (class DefaultLifecycleObserver), add this dependency to your android module:
implementation 'android.arch.lifecycle:common-java8:1.1.0'
I want to make a react-native app which can read the NFC tags. I am using react-native-nfc but cannot get it working. Can anyone help with figuring out what I am doing wrong and point me in the right direction?
Code in index.android.js is the following:
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
ToastAndroid
} from 'react-native';
import NFC, {NfcDataType, NdefRecordType} from "react-native-nfc";
export default class nfcTry extends Component {
constructor(props){
super(props);
}
componentDidMount(){
this.bindNfcListener();
}
bindNfcListener(){
NFC.addListener((payload)=>{
alert(payload.data.id);
})
}
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
</View>
);
}
}
Code in AndroidManifest.xml is the following:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nfctry"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.NFC" />
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED"/>
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED" android:resource="#xml/nfc_tech_filter" />
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
Finally i am able to make it to the goal!!
at this point of time your total code is missing with another npm package called nfc-ndef-react-native.
Link the following package with your existing code and you might face some issues with NDK , solve them too ! finally you would be able to make it!! I am running this app right now as needed.