Open 1mehdifaraji opened 2 years ago
didn't work for me either "react-native": "0.67.4", "react-native-android-sms-listener": "^0.8.0"
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.
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.
"react": "17.0.2", "react-native": "0.66.1", "react-native-android-sms-listener": "^0.8.0",