react-native-voip-push-notification icon indicating copy to clipboard operation
react-native-voip-push-notification copied to clipboard

error run: Expected a type

Open fukemy opened this issue 3 years ago • 4 comments

plz help i got this error: Screenshot 2022-09-06 at 11 48 26

fukemy avatar Sep 06 '22 04:09 fukemy

hi, any update on this issue? i'm experience similar thing too

Fauzee26 avatar Jan 05 '23 10:01 Fauzee26

I've got the same error running on M1 with reactnative 0.61.5 and Simulator Iphone 11.0

wandersonsousa avatar May 06 '23 14:05 wandersonsousa

For anyone having this issue, just put this import:

#import <PushKit/PushKit.h>

inside this file located at RNVoipPushNotification pod files:

RNVoipPushNotificationManager.h

wandersonsousa avatar May 09 '23 19:05 wandersonsousa

For anyone having this issue, just put this import:

#import <PushKit/PushKit.h>

inside this file located at RNVoipPushNotification pod files:

RNVoipPushNotificationManager.h

To maintain this update on every pod install, add this code to podfile

**This should be inside post_install do |installer|** find_and_replace("../node_modules/react-native-voip-push-notification/ios/RNVoipPushNotification/RNVoipPushNotificationManager.h", "#import <React/RCTEventEmitter.h>", "#import <React/RCTEventEmitter.h> #import <PushKit/PushKit.h> ")

This should go in the final of podfile def find_and_replace(dir, findstr, replacestr) Dir[dir].each do |name| text = File.read(name) replace = text.gsub(findstr,replacestr) if text != replace puts "Fix: " + name File.open(name, "w") { |file| file.puts replace } STDOUT.flush end end Dir[dir + '*/'].each(&method(:find_and_replace)) end

wandersonsousa avatar May 09 '23 20:05 wandersonsousa