I'm also want that kind of tutorial
Phonegap and laravel
It will be very helpful if we can have a tutorial on Phonegap and laravel for mobile development.
It will be great if we have some lessons similar to http://code.tutsplus.com/courses/hands-on-with-phonegap
Laravel -> server side framework
Phonegap -> mobile app framework
you mean Phonegap tutorial on Laracast? (like React etc.)
PhoneGap is just a web application with javascript APIs to mobile functionality (camera, address book, etc). You can build an app with ReactJS, React Native, Angular, jQuery, or plain HTML, CSS, and JavaScript. Then just do REST calls to a Laravel application (Lumen would be a nice choice here).
There are some great Node based CLI tools for building PhoneGap apps for all of the major players (iOS, Android, Windows, etc).
Yeah, you can't technically have laravel in a phonegap app...
Expanding a little on @luddinus response...
Laravel -> build your rest API using laravel, no view handling... Simply an API
Frontend -> build your frontend using HTML5, CSS, if needed a JS Framework of your choice (angular, ember) (remember React is the VIEW portion) Make calls to the Laravel API using ajax requests or whatever method is provided by your JS framework.
PhoneGap -> build your JS app in PhoneGap
I recommend using the PhoneGap Build, pretty nice little service makes deployment a breeze.
@dberry, excuse my understanding of this, but how would you protect from XSS when using angularJS and Phonegap to make requests to lumen?
It doesn't make sense to me that if you've already built a responsive web app using blade rendering that you should have to REDO your whole app using client side rendering.
Maybe it has some performance advantages but for lots of people still probably not worth it.
Anyhow, I think you don't have to. Here's the line from the iOS store that I think trips everyone up: "Your app should be engaging and useful, and make the most of the features unique to iOS. Websites served in an iOS app, web content that is not formatted for iOS, and limited web interactions do not make a quality app."
It does't even say anything specific about having to have things rendered on the front end...I guess people just assume you have to because then at least you can claim you're doing it for the performance advantage?
Anyhow...I THINK people have gotten around this by using some native features. If you want the marketing advantage of "having an app" in the app store you should create a feature that makes good use of the iOS features. For example, if you have a recipe website, having a feature that lets you take photos on your phone of your creation and add them. I think you'd still have to use angular or another front end method to build this feature, but you wouldn't have to redo the WHOLE app. You then create a homescreen that has two links "Photo Uploader" and "Search Recipes" (or something else that takes you to the main site). You MAY have to advertise the app as being "MyRecipeFinder Photo Uploader"...hopefully not though? Honestly though still would get your brand into the store, and like I said I'm pretty sure from there you can "embed" your main app content...
I found an article that seemed to confirm this (which of course I can't find now..) but I'll keep looking. I know lots of maybes but wanted to post incase it helped someone..
Also this!! https://gonative.io/
Thanks for the share sgelbart! It looks very promising. I'm going to research more and make comparisons. This is a perfect quick solution for my startup.
It's about eyeballs. PhoneGap, Ionic, etc, lets you deploy an app to the App Stores. This equals a potentially huge increase in exposure. People get "apps". "Web apps" is not as widely understood by the public. Plus, you get access to the mobile sensors (geolocation, etc), which can make for some cool new features for your app.
I'm just getting into PhoneGap, so that's just my current evaluation of its benefits.
Does it allow you access the camera for barcode scanning too?
@andy yep, phonegap supports barcode / QR scanning etc
Thanks!
I'm using Laravel for my backend API & desktop/mobile site, then Ionic/Cordova for our mobile apps. Works great!
@tjphippen yep. it didn't take long before I came to the same conclusion and ended up only using Ionic/Cordova and dropped PhoneGap out of the stack. Now making apps that use Laravel as a back-end, that serves web and iOS via API.
Now a days it seems like rather than generating everything server side it's best to just build an API & even treat your web site as just another client that connects to it. I'm slowly getting away from blade & trying to generate all views from data pulled via the API but old habits die hard :/
You guys are seriously masochistic if you're thinking about re-building your whole front end when you don't have to!
37 SIGNALS (FONDERS OF RUBY ON RAILS) RENDER THEIR CONTENT FOR THEIR APP SERVER SIDE
Don't rebuild your whole font end using React. Just wrap your existing app using Phonegap or a native wrapper.
Seriously. People reading this thread are going to waste an insane amount of time, and it ends up coming at the cost of developing new features when you have to implement them using two UIs.
Even if you haven't build your app yet, using React or Angular isn't a decision to be taken lightly, it's harder to code and maintain IMO then backend rendering. If your app NEEDS to be real time or uses a TON of JS then go for it, but it looks like companies like AirBnB and LinkedIn mostly still use backend rendering!
And YES you can still use native and PhoneGap plugins if you need to EXTEND your app. Your wrapped app and phonegap can communicate. It's MAGICAL. Yes we have done this it works.
Here's a link to 37Signals proving I'm not crazy: https://signalvnoise.com/posts/3743-hybrid-sweet-spot-native-navigation-web-content
GoNative.io apps and Basecamp seem to have had no problem getting into the iOS or Android stores using this method!!!
I'm always amazed at how much harder the Laravel community makes things the the Rails community. Guys, you're smart but that doesn't mean you have to make everything more complicated. And I know everyone wants to play with React and Ionic, but there's no NEED to in this situation. I'm not going to get into benchmarks, but my guess is the user won't notice the difference, especially if you employ pre-rendering, caching, etc (things you should do on your app either way!)
Swift 2.
Keep your blade templates the way they are and wrap in a WebView/InAppBrowser.
or use http://GoNative.io
Hey @sgelbart can you give a link or two for what you mean by " wrap in a WebView/InAppBrowser" ? Maybe some example, tutorial or even a documentation page. Thank you :)
Kinda :-) another dev on our team did full the full implementation...but...to explain more...
You know on the Facebook app on your mobile, when you click a link, it'll open the full website but you'll still be in the app?
That's called a WebView or InAppBrowser
So, you have your native app, which essentially just opens a link to your app in a browser. AND NO ONE NOTICES THE DIFFERENCE (assuming it's optimized for mobile resolution).
Why create a mobile app at all then? For us, the answer was 1) always-on push notifications 2) being able to say "we have an app". In general why does anyone really want a mobile app anymore anyhow???
You can create this wrapper using Cordova or just coding it native. I believe when you use Cordova you're using "InAppBrowser" but when you use native you're using "WebView".
If you need to use some native feature or a PhoneGap/Cordova plugin you can. For example, we use PhoneGap push notifications and File Upload.
A few gotchas we encountered (that I know there were workarounds for...but I'll have to get back with more...)
- there are some ugly zoom buttons you have to remove
- upload doesn't work from within webview/inappbrowser (you need to code this as a native/phonegap plugin) ...there might be more but those are all I can think of right now :-)
Here's documentation on Cordova site:
https://cordova.apache.org/docs/en/3.0.0/cordova/inappbrowser/inappbrowser.html
Native Andorid:
http://developer.android.com/guide/webapps/webview.html
Native iOS:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIWebView_Class/
What do you mean by swift 2?
@sgelbart It really depends on the type of your app. In Rails they like to praise Turbolinks and the monolithic app design which is not where we are going as an industry. I find React Native very fun to work with. Of course it requires more work than rendering a web view, but the whole point is having the native feel easier than before. It's certainly easier than using Swift and Java.
I will put it that way. If you're using a web view then most of the chances you don't even need a mobile app and you're doing it just for the sake of doing it. Can you imagine Facebook or WhatsApp just rendering a web view?
If you wanna go your way then just use Meteor.js. One command on the Terminal and you get a mobile app that works for IOS and Android.
Swift 2 is iOS programming language for building apps.
@IsaacBen the point is that:
- I don't want to rebuild my whole app in Meteor or another language. Most people coming to this thread probably already have an existing app in Laravel
- People want to say they have an app - need it or not. They don't notice if it's native, if it's a copy of the web app - hell you can give it slightly different buttons if you need to make it FEEL different - they just want users to be able to go to the app store and download it. To be able to say they have an app in the iPhone or Android marketplace. That's just the way it is right now. And...no...I don't notice the difference between ajax apps and mobile optimized sites and I don't think most users will. Facebook did a bad job on their mobile site, but with other web sites I would never notice the difference.
@sgelbart is spot on. There's no need to build an entirely new front end in React, Angular or any other JS framework.
These are buzz words right now but in my experience, a lot of folks shouting about them on twitter and blog posts have yet to build a commercial application with real deadlines. There's a huge learning curve and mental shift from static blade views.
Previously, I built an app for a client and they came back looking an app version. It needed to have the same functionality. I got a few weeks into a rebuild with React and Phonegap until I realised I was wasting my time as the data was not changing that much and the UI was exactly the same.
I stumbled upon GoNative.io and was able to wrap the existing URL in about 30 minutes. Now, updates go to the webapp and native app at the same time and my client has an app in the app store.
I wrote a GoNative Developer Review to help anyone that's planning to wrap their app.
Please or to participate in this conversation.