-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Adjusted the Listener logic to fix the crash when even published. -Adds the demos as well. -Upgrades the version to 0.1.5
- Loading branch information
Showing
5 changed files
with
78 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
android/src/main/java/com/sunmi/innerprinter/PrinterReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.sunmi.innerprinter; | ||
|
||
import android.content.BroadcastReceiver; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.bridge.ReactContext; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import com.facebook.react.modules.core.DeviceEventManagerModule; | ||
import android.util.Log; | ||
|
||
public class PrinterReceiver extends BroadcastReceiver { | ||
public PrinterReceiver() { | ||
} | ||
|
||
@Override | ||
public void onReceive(Context context, Intent data) { | ||
String action = data.getAction(); | ||
String type = "PrinterStatus"; | ||
Log.d("PrinterReceiver", action); | ||
SunmiInnerPrinterModule.reactApplicationContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) | ||
.emit(type, action); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "react-native-sunmi-inner-printer", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "http://docs.sunmi.com/htmls/index.html?lang=zh##V1文档资源 根据商米V1文档开发的蓝牙打印for React Native.", | ||
"author": "Janus J K Lu <[email protected]>", | ||
"contributors": [], | ||
|
3f3618e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#14 fixed as well