해당 앱이 설치된 휴대 기기를 탐색하는 경우 기본 IOS 앱을 실행하는 코드/링크를 찾고 있는데 사용하지 않는 경우 웹 기반 URL로 다시 리디렉션합니다. 모바일 기기 또는 앱 (facebook, youtube 등)이 설치되어 있지 않은 경우 fb : // action /을 통해 네이티브 앱을 시작할 수 있지만 fb 앱이 설치되어 있지 않은 경우 웹 기반 페이지로 다시 리디렉션하는 방법을 알아낼 수 없습니다. 나는 어떤 상상력의 스트레칭으로 프로그래머가 아니지만, 나는 며칠 동안 읽고 너무 많이 배웠습니다! 이것에 대한 통찰력은 나에게 많은 것을 의미 할 것이다.휴대 기기에서 브라우징하지 않을 경우 웹 기반 URL로 리디렉션
1
A
답변
1
당신은 거기서 프로그래밍을 할 수 없을 것입니다. 브라우징 장치가 모바일인지 여부와 같은 깔끔한 것들을 할 수있는 서버 측 스크립팅 언어 인 php와 리디렉션과 같은 작업을 필요에 따라 수행합니다.
한 번 인터넷에서 뭔가를 발견했습니다. 나는 그것이 당신의 필요에 맞을 수 있도록 그것을 조정했습니다. 의견은 모든 것을 설명해야합니다.
<?php
// Get the user agent
$user_agent = $_SERVER['HTTP_USER_AGENT'];
// Create an array of known mobile user agents
// Most mobile devices send a pretty standard string that can be covered by
// one of these. I believe I have found all the agents (as of the date above)
// that do not and have included them below. If you use this function, you
// should periodically check your list against the WURFL file, available at:
// http://wurfl.sourceforge.net/
$mobile_agents = Array(
"240x320", "acer", "acoon", "acs-", "abacho", "ahong", "airness", "alcatel", "amoi", "android", "anywhereyougo.com", "applewebkit/525", "applewebkit/532", "asus", "audio", "au-mic", "avantogo", "becker", "benq", "bilbo", "bird", "blackberry", "blazer", "bleu", "cdm-", "compal", "coolpad", "danger", "dbtel", "dopod", "elaine", "eric", "etouch", "fly " , "fly_", "fly-", "go.web", "goodaccess", "gradiente", "grundig", "haier", "hedy", "hitachi", "htc", "huawei", "hutchison", "inno", "ipad", "ipaq", "ipod", "jbrowser", "kddi", "kgt", "kwc", "lenovo", "lg ", "lg2", "lg3", "lg4", "lg5", "lg7", "lg8", "lg9", "lg-", "lge-", "lge9", "longcos", "maemo", "mercator", "meridian", "micromax", "midp", "mini", "mitsu", "mmm", "mmp", "mobi", "mot-", "moto", "nec-", "netfront", "newgen", "nexian", "nf-browser", "nintendo", "nitro", "nokia", "nook", "novarra", "obigo", "palm", "panasonic", "pantech", "philips", "phone", "pg-", "playstation", "pocket", "pt-", "qc-", "qtek", "rover", "sagem", "sama", "samu", "sanyo", "samsung", "sch-", "scooter", "sec-", "sendo", "sgh-", "sharp", "siemens", "sie-", "softbank", "sony", "spice", "sprint", "spv", "symbian", "tablet", "talkabout", "tcl-", "teleca", "telit", "tianyu", "tim-", "toshiba", "tsm", "up.browser", "utec", "utstar", "verykool", "virgin", "vk-", "voda", "voxtel", "vx", "wap", "wellco", "wig browser", "wii", "windows ce", "wireless", "xda", "xde", "zte"
);
// Pre-set $is_mobile to false.
$is_mobile = false;
// Cycle through the list in $mobile_agents to see if any of them
// appear in $user_agent.
foreach ($mobile_agents as $device) {
// Check each element in $mobile_agents to see if it appears in
// $user_agent. If it does, set $is_mobile to true.
if (stristr($user_agent, $device)) {
$is_mobile = true;
// break out of the foreach, we don't need to test
// any more once we get a true value.
break;
}
}
//check whether mobile is true, and if so, redirect to mobile page
if($is_mobile){
header("Location:http://www.mobilepage.com"); //replace domain
exit;
}else{
header("Location:http://www.notmobilepage.com"); //replace domain
exit;
}
?>
다른 대안을 보여주는 this도 참조하십시오.
관련 문제
- 1. 휴대 기기에서 웹 서비스를 사용할 때 연결이 끊어지는 경우
- 2. 휴대 기기를 사용하지 않을 때 리디렉션
- 3. 승인되지 않은 경우 URL로 리디렉션
- 4. 휴대 기기에서 작동하도록 웹 사이트를 수정하려면 어떻게해야합니까?
- 5. 휴대 기기에서 스크롤 사용
- 6. 휴대 기기에서 끝없는 스크롤
- 7. 휴대 기기에서 이동하는 요소
- 8. 휴대 기기의 경우 Facebook의 맞춤 탭에서 사용자 리디렉션
- 9. 문자열이없는 경우 다른 URL로 리디렉션 [JAVASCRIPT]
- 10. 변수가 공백으로 구성된 경우 사용자를 URL로 리디렉션
- 11. 휴대 기기에서 CSS 호버링이 작동합니까?
- 12. Nginx가 외부 URL로 리디렉션
- 13. 휴대 기기에서 버튼 모양이 변경되었습니다.
- 14. 휴대 기기에서 이미지를 게재하는 방법
- 15. 휴대 기기에서 레일스 애플리케이션에 액세스하기
- 16. 다시 작성한 URL로 리디렉션
- 17. 다른 URL로 리디렉션 요청
- 18. 조건이 충족되지 않을 경우 강제 리디렉션
- 19. Wordpress에서 원격 URL로 리디렉션
- 20. Facebook 로그인 버튼이 휴대 기기에서 리디렉션되지 않습니다.
- 21. 리디렉션 기반 액세스
- 22. 휴대 기기에서 시간대를 사용 하시겠습니까?
- 23. 휴대 기기에서 터치 스크린 시뮬레이션
- 24. 휴대 기기에서 PayPal로 P2P 결제
- 25. codeigniter의 referer url로 리디렉션
- 26. 휴대 기기에서 다른 레일 레이아웃, 동일한보기 사용
- 27. 사용하여 원하는 대상 URL로 리디렉션 즉, 내가 웹 페이지가
- 28. 301 동적 URL로 리디렉션
- 29. 검색 URL로 리디렉션
- 30. j2me의 URL로 리디렉션