NetTalk Central

Author Topic: Mobile detection and redirecting  (Read 5072 times)

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Mobile detection and redirecting
« on: November 09, 2011, 12:03:03 AM »
Hey all,

Just wondering if there was an elegant way to detect whether someone is accessing the site via an iOS device and redirecting them to a separate series of pages that have been designed in jQuery Mobile at all?

I know that there is a .mobile property now that is accessible, but where is the best place to detect this, and should I be putting code in the WebHandler procedure to direct the user to the appropriate pages?

I am thinking along the lines of having, say 'IndexPage' as the home page for the desktop, and 'IndexPage_mobile' as the corresponding home page for the iOS device and automatically serving either page up depending on the .mobile parameter.

Could we get even trickier and support THREE sets of pages, i.e. desktop, iPhone and iPad?

Or am I jumping the gun here, and will NT6 solve all these issues for me??  ;D

Thanks!
Devan

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Mobile detection and redirecting
« Reply #1 on: November 09, 2011, 02:14:46 AM »
Devan,

Hey hey.

I was thinking about this the other day.

With the Multi-Server example, my theory (haven't actually coded anything yet) is that you would start off by checking in the webhandler of the server that redirects, and based on what got parsed out of p_web._UserAgent (not .UserAgent, doesn't have enough info) I'd redirect to the needed webserver.

This is a scenario where you have separate web servers for each "type" of device (mobile, tablet, computer).

Don't know if it's feasible, wise or even possible.

It would probably be easier, now that I think about your question a bit more, to just examine p_web._UserAgent in the WebHandler of the webserver solo (only having one, not multi-site) and redirect to the index or whatever set of pages based on that.
Cheers,

Stu Andrews

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Mobile detection and redirecting
« Reply #2 on: November 09, 2011, 04:36:07 AM »
I think this topic is best revisited after the NT6 build Devan.

The short answer is that (to some extent) the question will be moot.

Cheers
Bruce

MikeR

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Email
Re: Mobile detection and redirecting
« Reply #3 on: November 09, 2011, 07:47:29 AM »
When is the long awaited NT6 going to make an appearance ?

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Mobile detection and redirecting
« Reply #4 on: November 09, 2011, 08:35:56 AM »
November 18th.  Bruce started a thread on it in the news section...
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: Mobile detection and redirecting
« Reply #5 on: November 09, 2011, 02:19:15 PM »
Thanks for the replies everyone.

Stu - I haven't even started to dabble in the multi server stuff yet, but looks like I will have to, as this now contract I just won specifies at least 3 sites running on their server for different companies.

Bruce - Thanks for the heads up.  I keenly wait for NT6... Even though I've just got go ahead for this big contract with a deadline for a 'before Christmas' ship date!!  ;)  Need any last minute NT6 beta testers??  ;D

Cheers,
Devan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Mobile detection and redirecting
« Reply #6 on: November 09, 2011, 10:12:48 PM »
Hi Devan,

I'm sure there'll be lots of beta testers coming out the woodwork on Nov 18 <g>.
That's only 8 days away, so not long to wait...


Cheers
Bruce

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: Mobile detection and redirecting
« Reply #7 on: November 09, 2011, 11:38:48 PM »
Haha - Thanks Bruce, and apologies for being cheeky...

My client actually today decided to defer the mobile portion of his site until next year, and only wants the desktop version completed by Christmas, so the mad urgency is off.

Next question - to wait and begin this project in NT6 from the ground up, or start in NT5 now and upgrade later?  I assume the upgrade path will be seamless?  Or perhaps there might be some code rewrites necessary?  ;)

Can't wait to begin beta testing...  :)

Devan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Mobile detection and redirecting
« Reply #8 on: November 10, 2011, 10:33:30 PM »
The upgrade will be pretty seamless, so starting in NT5 is no problem at all.

Of course the Wizard is included in NT6, so if your dict is ready you can just run the wizard and see the who app just pop out in front of your eyes. It's pretty cool to watch really. So if you want something to work on till next friday, get your dictionary planned and start working on the reports. (the wizard doesn't do reports.).

cheers
Bruce