@@ -1625,11 +1625,12 @@ public void printTextBitmap(ReadableMap config, final Promise promise) {
16251625 try {
16261626 if (iminPrintUtils == null ) {
16271627 String text = config .getString ("text" );
1628+ Log .d ("printText===>" ,"text===> " +text );
16281629 if (config .hasKey ("align" )) {
16291630 int align = config .getInt ("align" );
1630- PrinterHelper .getInstance ().printTextBitmapWithAli (text + " \n " , align , null );
1631+ PrinterHelper .getInstance ().printTextBitmapWithAli (text , align , null );
16311632 } else {
1632- PrinterHelper .getInstance ().printTextBitmap (text + " \n " , null );
1633+ PrinterHelper .getInstance ().printTextBitmap (text , null );
16331634 }
16341635 }
16351636 promise .resolve (null );
@@ -2035,7 +2036,13 @@ private void initializeBroadcastReceiver() {
20352036 mBroadcastReceiver = createChargingStateBroadcastReceiver ();
20362037 intentFilter .addAction (ACTION_PRITER_STATUS_CHANGE );
20372038 intentFilter .addAction (ACTION_POGOPIN_STATUS_CHANGE );
2038- getReactApplicationContext ().registerReceiver (mBroadcastReceiver , intentFilter );
2039+
2040+ // For Android 13+ (API 33+), we need to specify RECEIVER_NOT_EXPORTED
2041+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .TIRAMISU ) {
2042+ getReactApplicationContext ().registerReceiver (mBroadcastReceiver , intentFilter , Context .RECEIVER_NOT_EXPORTED );
2043+ } else {
2044+ getReactApplicationContext ().registerReceiver (mBroadcastReceiver , intentFilter );
2045+ }
20392046 }
20402047
20412048 @ ReactMethod
0 commit comments