react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
745 stars 285 forks source link

1.2.x fails to build with error: expected a type #113

Closed geraintwhite closed 4 years ago

geraintwhite commented 4 years ago

Bug

After updating to 1.2.0 from 1.1.1, the module fails to build in Xcode with the following error:

RNCPushNotificationIOS.h:22:41: error: expected a type  + (void)didReceiveNotificationResponse:(UNNotificationResponse *)response API_AVAILABLE(ios(10.0));

Environment info

react-native info output:

info
  React Native Environment Info:
    System:
      OS: macOS 10.15.3
      CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
      Memory: 1.29 GB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.4.0 - ~/.nvm/versions/node/v12.4.0/bin/node
      Yarn: 1.5.1 - /usr/local/bin/yarn
      npm: 6.9.0 - ~/.nvm/versions/node/v12.4.0/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
    IDEs:
      Android Studio: 3.6 AI-192.7142.36.36.6241897
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.13.1 => 16.13.1
      react-native: 0.59.10 => 0.59.10

Library version: 1.2.0

sairam-405 commented 4 years ago

Hi @grit96

import <UserNotifications/UserNotifications.h>

import above one in RNCPushNotificationIOS.h file then it will works. If you want you can take fork and change the file and then install library through your git url

YevheniiShabelnykkk commented 4 years ago

It's not working. Could someone help with this? Have the same error. It happened after updating to 1.2.0 from 1.1.1.

anthowm commented 4 years ago

after a clean install of my project it stop working because it update to 1.2.0 with this error.

dilipsuthar97 commented 4 years ago

Thank you @sairam-405 it's working fine after importing ✌

#import <UserNotifications/UserNotifications.h>
saintego commented 4 years ago

Are you planning to do some fix? I have this issue on appCentre build

saintego commented 4 years ago

It seems it is working after updating XCode from 10 to 11.5 on AppCentre

Naturalclar commented 4 years ago

I've landed the fix and released it as 1.2.2 :tada: thanks @grit96 !