An EasyStore react-native library to merge StarIO Android and IOS sdk for react native app.
- Copy the library folder to AppDirectory/node_modules folder. (Example : MyApp/node_modules.
- Open terminal and run following command in your project root path
$ react-native link react-native-star-printing
-
Go to Target settings >
General
tab, make surelibRNReactNativeStarPrinting.a
is inLinked Frameworks and Libraries
section -
Go to
Frameworks
> check for if all frameworks has been included.i.
Foundation.framework
ii.CoreImage.framework
iii.CoreBluetooth.framework
iv.QuartzCore.framework
v.ExternalAccessory.framework
vi.UIKit.frameworkCoreGraphics.framework
vii.StarIO.framework
viii.SMCloudServices.framework
ix.StarIO_Extension.framework
-
If not present, then you can right-click on
Frameworks
> Add Files to “Your-Project-Name” > AddStarIO.framework
,SMCloudServices.framework
,StarIO_Extension.framework
. For adding other frameworks, go toProject Settings
> targetBuild Phases
>Link Binary with Libraries
> click ‘+’ and add these frameworks :Foundation.framework
,CoreImage.framework
,CoreBluetooth.framework
,QuartzCore.framework
,ExternalAccessory.framework
,UIKit.frameworkCoreGraphics.framework
-
Navigate to
AppProject/node_modules/react-native-star-printing/node_modules
and deletereact-native
folder
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNReactNativeStarPrintingPackage;
to the imports at the top of the file - Add
new RNReactNativeStarPrintingPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-star-printing' project(':react-native-star-printing').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-star-printing/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-star-printing')
var StarPrint = require("react-native-star-printing");
// TODO: What to do with the module?
RNReactNativeStarPrinting;
Let receiptDetails = “file:////something.png”
StarPrint.print(receiptDetails).then(function(result) {
console.log(result);
});