Phonegap - gap in tutorial for iOS? - ios

Despite the title, I fully expect this to be a user error.
I've done mostly native Android development, and now I'm trying to get an HTML5/Phonegap application going on iOS. I'm following the extended "getting started" tutorial Here. I get the application up and running on a physical test device, but my phonegap functionality is non-responsive, so something is amiss.
Take a look at the following screenshots from the tutorial, we'll call this step 3:
The screenshot above is what my project looks like at this point. I see the PhoneGap.framework in there, so I'm feeling optimistic. Step 4 says, drag your "WWW" folder into your project, which I did (assuming the red box indicates the landing zone), and I was prompted with the screenshot presented in the tutorial, I selected the same options..
Step 5 shows the screenshot above. Notice the differences:
PhoneGap.framework isn't there anymore
There is another project in the workspace called PhoneGapLib.xcodeproj
There was only one simple step in between, yet the project looks very different. It seems to me, that more things happened than just dragging the www folder?? I know thousands of people are using PhoneGap with iOS, so I'm hoping one of you can shine a light on what went wrong here.

Ok, looks like this was indeed a user error. When you create the PhoneGap project, you're supposed to run a build before you do anything. This generates the www folder, but doesn't actually add it to your project. You have to go to the folder location where your app resides, and drag the created www folder into the project.
I was dragging my own www folder that already had my code that works in Android. Not sure why this didn't work.
In my defense, even now that it's working, my project doesn't look like the screenshot above with the additional phonegap project. Either way - I hope this saves someone some time...

Related

Xamarin iOS Splashscreen not showing

If followed these instructions: https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/launch-screens?tabs=macos
The LaunchScreen never shows up. I am using VS2019 for Mac current build. Followed all instructions to the letter.
Update:
github sample project as requested.
https://github.com/tpitman/Xamarin-Forms-SplashScreenTest
I created a new cross platform forms solution. I downloaded an image of the Xamarin logo. The project already has a LaunchScreen.storyboard. It also already had an image view object, but I deleted that and added a new one because the steps on that link above said to add one. I also added the label just like those instructions say.
You will notice when you run it that the label shows up, but the image does not. That is the problem. In my app I don't have or need a label. I just have an image I want to show.
Update 2:
I deleted the above repo. Created a new project including Android this time (not sure that matters, but it represents my real situation).
I also changed the image I used from the stock one to my own in case that matters.
I then built it and it does NOT work as the original one didn't. Hopefully it won't work for you as well.
I also created a video of it not working. Here is the link to that video:
https://drive.google.com/file/d/1Uy0KfDq0_5IfrqDDaMVDNeGylibzUH5m/view?usp=sharing
Update 3:
In the end I am not sure what fix it. I removed and reimported the images. I have 3 projects and 2 of them work fine now using the Assets.xcasset method and the other one I couldn't get to work that way, but works with the images being in the Resources folder.
I think one thing that I did that seemed to make a difference was I did a clean and then build and that seemed to fix it.
I have checked the shared github sample project, it works in my local site. Both in VS for Mac (8.8.4) and VS for PC(16.8.3).
==================================Update================================
There is a workaround to solve that, you could add Image to Resouces directly.
Then use it in LaunchScreen.Storyboard, then it will show:

How can you permanently change iOS app configuration in Meteor Cordova?

Every time I meteor build, I have to open XCode and do the following:
remove and add an item from "Link Binary With Libraries" (Facebook SDK)
add a URL Type (custom URL scheme for my app)
add a "Required device capabilities" to "Custom iOS Target Properties"
How can I edit my Meteor project to have these steps done automatically, and to auto add things to AndroidManifest.xml?
In some way use mobile-config.js or cordova-build-override?
I'm happy to see another guy who is trying to build a hybrid application using Meteor / extending a Meteor Cordova iOS app, since I'm facing the very same issues. So I'm very happy to share my experiences and approaches with you. :-)
So far, I ended up with the following approach:
I created a base template for my iOS app using meteor build (not meteor run ios-device, since I did not know if Meteor does some optimizations for production code).
Then, I copied the whole Xcode project under /platforms/ios to another loaction and used this new project as my "master" project from then on. This project is being enriched with native code, e.g. it also includes the Cocoa Pods I'm needing.
Of course, I also did not want to copy files each and every time I trigger a new Meteor build. At least, I would like to have the Staging/www folder updated, as this is happening quite frequently.
So my first (rather naive) approach was
delete the Staging/www folder in the master project
replace it with a relative link (using Xcode's linking functionality) to the Staging/www folder inside the .meteor/local/.../ios/ project
This approach did not work, since the shell script used in the Meteor Xcode project can't handle these links.
My second approach is to create a symlink on the filesystem level instead. This works as it should, and I'm able to build the project in Xcode as it should.
I could have followed the same approach for the Cordova plugins folder, but I've decided to replace the plugins manually in order to get a better control over them, even it means a bit more effort then.
Having the symlink in place also means that Xcode's version management (and also SVN which I am using for everything) will ignore everything below Staging/www, which is good in my opinion, because I'm already versioning the webapp code in the Meteor project itself.
BTW: I've started a discussion thread on hybrid mobile app on the Meteor forums as well, but so far it did not get too much attraction:
https://forums.meteor.com/t/building-a-hybrid-meteor-cordova-app-share-experiences/8212
Maybe we could follow up on Meteor-specific things there, to have the Meteor community participate in the discussion?
EDIT: I would also like to share an approach that failed completely, at least for me, maybe I was too dumb... Before I used Meteor's Xcode template as the starting point, I also tried it "the other way round", i.e. I started with my already existing Xcode app project and tried to include Meteor's / Cordova's part by hand. Using this approach, I never managed to set everything up correctly. I had lots of troubles and also had to tweak a lot of the compiler / linker flags to even get the code compiling. This grew me a lot of gray hairs. But even after I managed to get everything to compile, Meteor hang during startup - and I never figured out why.
One remaining problem I'm still facing is that Meteor's hot code push functionality seems to have some severe issues on iOS, that are also documented as GitHub issues. It can happen that the iOS app gets completely broken and needs to be reinstalled. I tried the mdg:reload-on-resume package, but this did not work as it should and made things even worse. As far as I can tell from the GitHub discussions, one should better disable hot code push until the Meteor team has addressed these issues. Breaking the app completely due to code pushes is not what my users would expect.
Unfortunately plist values (and assumably AndroidManifest.xml as well) can only be changed by a plugin:
Add entry to iOS .plist file via Cordova config.xml

More FacebookSDK/Facebook.h issues - file not found

Alright, guys. I'm going freakin' crazy with this one. It is utterly ridiculous that the FacebookSDK causes so many issues. I know there are a couple questions on here regarding this issue, but they all seem to be outdated.
I pulled my Xcode project onto a new computer, and can't build it because I get the "FacebookSDK/FacebookSDK.h" file not found error. There are answers such as This one, but I've followed the steps in every single answer and haven't found one that works. I've just made a fresh pull from my working project from the original machine to the new one. I'll take some screenshots showing my current settings for various fields mentioned in other answers, and maybe I Just have something wonky that is interfering.
Here are the contents of the SDK that I just downloaded
Here are the contents of my Xcode project folder. There isn't anything else Facebook in here.
Here are the frameworks inside my Frameworks group and inside the Link Binary with Libraries section of Build Phases
There are a couple frameworks that are red, and that's OK for now. They were not in the repo, and are instead referenced from Documents or Downloads, and they played nice when I moved the files over and linked them. I just reset my repo to when I pulled it to make sure I didn't have anything from weird stuff I tried that prevents a proper solution from working.
Framework search paths. You can also see that my library search paths is empty. I labeled the stuff I wanted to hide, as it was identifying information
For some reason, my Documents for the new machine is already under the framework search paths. I did not add this myself.
Any ideas on what I can try? This is endlessly frustrating. I've wasted an entire day of development on trying to get Facebooks SDK re-integrated on a new machine.
I was also face the same problem every time I got the checkout for new version from svn.What I did was just removed the Facebook SDK and add again from the backup.It taken me out that time.Please try this might be it works for you.

How to deploy a SenchaTouch App with Cordova?

A friend send me the code of a SenchaTouch App (v2.0) he made. I should make some changes as the performance is not so good. To start, I want to "deploy" the App on my iPad and see where its slow. He told me that he didn't use SenchaCmd and the Cordova version seems a little bit older, too. In the picture below you can see the project structure. How can I deploy the App to my iPad (there are no XCode project files in these folders)? In the future I will do a complete refactoring of the App but for the moment he wants me to do some little performance tweeks with his code... Any suggestions?
Andres commnt was the correct hint. I could just create a new cordova/phonagap project with the command line and then put the contents of the folder in the www directory.

ponydebugger on xcode , code snippets not showing

Trying to follow this video as to how to make the ponydebugger work with my xcode project
http://cocoaheads.tv/ponydebugger-by-jay-thrash/
I'm stuck at 10:00 when he tries to drag the code snippet from the library. When I go to mine and go to Users, nothing shows up. I'm not sure if I messed up my installation.
He created those code snippets manually in Xcode so he doesn't have to type during the demo. This isn't something that gets installed by PonyDebugger. To follow the demo, you can simply type what he drags in.
For more information on Xcode Snippets (which are awesome), see this article: http://nshipster.com/xcode-snippets/
Hope that helps!

Resources