1

I am implementing push notification using pushwoosh on my iOS app made with phonegap/cordova.

I followed this tutorial (but stuck on step 1): http://www.pushwoosh.com/programming-push-notification/ios/ios-additional-platforms/push-notification-sdk-integration-for-phonegap/

I downloaded the SDK from here: https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin

I got these files under "ios" directory from SDK:

  • PushNotification.h
  • PushNotification.m
  • Pushwoosh.framework [folder]

I can't install the plugin using the terminal so i'm trying to install the plugin manually (if you can send me link on how to install plugins manually and automatically, please do. Thanks), what I did is I dragged the file Pushwoosh.framework into the "Frameworks" folder in my XCode project, then I dragged the Pushnotification.h and Pushnotification.m to the "Classes" folder. When I build and run the app, the following error appears:

 Lexical or Preprocessor 'PushNotificationManager.h' file not found

and it's highlighting the following code on PushNotification.h:

 #import "PushNotificationManager.h"

What does this error mean?
What did I do wrong?
What is the correct way to install these plugins manually?

Thank you.

Update:
I changed

 #import "PushNotificationManager.h" 

to

 #import <Pushwoosh/PushNotificationManager.h> 

and now I get tons of Apple Mach-O Linker error messages saying

"Undefined symbols for architecture i386"

clintgh
  • 2,039
  • 3
  • 28
  • 44
  • That error means that a particular file is missing. In your case `PushNotificationManager.h` file is missing. Checkout the source code and find out that file must be there in order your code to compile properly. – Janak Nirmal May 27 '14 at 06:04
  • Hi, the file is actually there, but it is inside the Pushwoosh.framework directory. I cannot upload a picture that's why i can't show. Do you know where i should put the files? Is it maybe because it's in different directories? – clintgh May 27 '14 at 06:09
  • I am not familiar with phonegap but best guess is you must be missing some configuration, just crosscheck with the documentation. – Janak Nirmal May 27 '14 at 06:14
  • I tried changing the linking of the import and now i get a different error. I updated the question. – clintgh May 27 '14 at 06:36
  • Why can't you install the plugin using terminal? Just run the command: phonegap plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin.git That's why phonegap made CLI so you don't have to config everything manually as this is error-prone process. – shader May 27 '14 at 09:21
  • I think it's a different issue, everytime i do that it says "Current directory is not a cordova-based project". – clintgh May 27 '14 at 09:51
  • what directory are you running the command in? make sure you run this in the root of your app project (the folder with the folders: merges, plaftorms, plugins, www) – shader May 27 '14 at 17:36
  • you should have .cordova file in this folder (it is hidden!) – shader May 27 '14 at 17:41
  • I guess I'll just rebuild my project, those folders are missing. :/ I think i'm on a wrong path here. Thanks for the responses though. – clintgh May 28 '14 at 02:48

2 Answers2

1

Okay, i fixed the problem and I'm going to share it if ever anyone experience (exactly) the same:

The link that I downloaded the SDK from is for native applications, so I downloaded it from the following instead: https://github.com/Pushwoosh/phonegap-cordova-push-notifications

And then did the same procedure for importing the plugins. I dragged it to the "Plugins" folder on my Xcode project, then next is I added the "AdSupport" framework on "Build Phases>Link Binary With Libraries (because it wasn't there and it is generating an error). Then there is still an error:

"The current deployment target does not support automated __weak references"

so I followed the instructions on this thread: Error Message: ARC is required to compile Pushwoosh SDK

I followed the rest of the tutorial about implementing pushwoosh on my app. And it's working now. So, basically I just got stuck on installing the plugin.

Lesson: Install plugins using the CLI. :)

Community
  • 1
  • 1
clintgh
  • 2,039
  • 3
  • 28
  • 44
0

If you want to add plugin manually: Pushwoosh plugin goes into plugins/com.pushwoosh.plugins.pushwoosh

It should also go to: platforms/ios/ProjectName/Plugins/com.pushwoosh.plugins.pushwoosh PushNotification.js should also go to platforms/ios/www/plugins/com.pushwoosh.plugins.pushwoosh/www

The easiest way is to use CLI.

shader
  • 2,121
  • 1
  • 13
  • 20