I am trying to run the Push notifications sample available on GitHub. Unfortunately, the configuration as outlined here doesn't work.
Docs say:
At the top of your AppDelegate.m
:
#import "[your-project-name]-Swift.h"
If your project name has spaces or hyphens, replace them with underscores in the import statement.
Example:
// Project name is "Test Project" or "Test-Project"
#import "Test_Project-Swift.h"
So I did for the sample:
#import "bms_samples_cordova_push-Swift.h"
ObjC Bridging Header is set to:
bms-samples-cordova-push/Plugins/ibm-mfp-core/Bridging-Header.h
Runpath is set to:
@executable_path/Frameworks
But Xcode throws the error above. What I am doing wrong?
I was able to get the
bms-samples-cordova-hellopush
sample application running using the following steps:Cloned the sample:
git clone https://github.com/ibm-bluemix-mobile-services/bms-samples-cordova-hellopush
Added my APPLICATION_ROUTE and APPLICATION_GUID in my
[your-directory]/www/js/index.js
(after configuring Push Notifications for my Mobile Services Starter application on BluemixAdded the iOS platform to my application:
cordova platform add ios@3.9
Added the Cordova plugin:
cordova plugin add ibm-mfp-push
Opened my
[your-app-name].xcodeproj
file in my[your-app-name]/platforms/ios
directory with Xcode (when I was prompted: Convert to Latest Swift Syntax, I clicked Cancel)Added the Bridging Header. Went to
Build settings > Swift Compiler - Code Generation > Objective-C Bridging Header
and added the following path:[your-project-name]/Plugins/ibm-mfp-core/Bridging-Header.h
Add the Frameworks parameter. Went to
Build Settings > Linking > Runpath Search Paths
and added the following parameter:@executable_path/Frameworks
Built Project
Uncommented the following Push import statements in my bridging header. Went to
[your-project-name]/Plugins/ibm-mfp-core/Bridging-Header.h
:Here is my updated
AppDelegate.m
:Hopefully I didn't miss anything :0)
I've contacted and opened up a few issues with the Cordova team to improve the quality of this sample to make it easier to set up.
Edit: Also, as noted from Sebastian below, you need to disable bitcode.