react-native-android-sms-listener icon indicating copy to clipboard operation
react-native-android-sms-listener copied to clipboard

Not working with latest react native version

Open 1mehdifaraji opened this issue 4 years ago • 5 comments

"react": "17.0.2", "react-native": "0.66.1", "react-native-android-sms-listener": "^0.8.0",

1mehdifaraji avatar Nov 19 '21 15:11 1mehdifaraji

didn't work for me either "react-native": "0.67.4", "react-native-android-sms-listener": "^0.8.0"

mouhsnimohamed avatar Jun 17 '22 10:06 mouhsnimohamed

Add the next lines in this path: src/types/declarations.d.ts

declare module 'react-native-android-sms-listener' {
  interface SmsListener {
    addListener: (handler: (value: string) => any) => import("react-native").EmitterSubscription;
    remove: () => void;
  }

  const SmsListener: SmsListener;
  export default SmsListener;
}

Remember, Google Play no longer allows you to use the READ_SMS and RECEIVE_SMS permissions (easily), so I recommend using another library if you're uploading your app to Google Play.

rafaelgp87 avatar Jun 23 '22 16:06 rafaelgp87

Thank you for your answer but I think this is not a Typescript problem! I already used sms-retriever without any permission and it worked but my client doesn't want to change the content of the SMS by adding the hash string as mentioned in the official doc.

mouhsnimohamed avatar Jun 23 '22 19:06 mouhsnimohamed

Add the next lines in this path: src/types/declarations.d.ts

declare module 'react-native-android-sms-listener' {
  interface SmsListener {
    addListener: (handler: (value: string) => any) => import("react-native").EmitterSubscription;
    remove: () => void;
  }

  const SmsListener: SmsListener;
  export default SmsListener;
}

Remember, Google Play no longer allows you to use the READ_SMS and RECEIVE_SMS permissions (easily), so I recommend using another library if you're uploading your app to Google Play.

Thank you for your answer but I think this is not a Typescript problem! I already used sms-retriever without any permission and it worked but my client doesn't want to change the content of the SMS by adding the hash string as mentioned in the official doc.

mouhsnimohamed avatar Jun 23 '22 19:06 mouhsnimohamed