Summary of mobile development experience

Source: Internet
Author: User

Share Configuration Reference Scripts
    1. Jquery/zepto
    2. Jweixin-1.0.0.js (//st02.chrstatic.com/themes/event/campaign/pofeng/common/js/jweixin-1.0.0.js)
    3. Appinteractive.js (//st02.chrstatic.com/themes/event/campaign/pofeng/common/js/appinteractive.js)
How to use
    1. The above script is introduced sequentially in the subsequent execution of JS:

       window.chrconfig = {     "isShare": true,     "shares": {         "shareTitle": "分享标题",         "shareContent": "分享内容",         "shareImageUrl": "图片url",         "shareUrl": "分享出去的链接"     } }; var active = new window.AppInteractive(chrconfig); active.wxShare();
    2. Precautions
      1. If your phone is connected to your computer and your computer is configured with host, you won't be able to access the HTTPS protocol link within your phone, and if you need to configure sharing within the app, the image URL must be an HTTPS protocol. Therefore, in the test, the picture loss situation is difficult to avoid.
      2. In iOS, if the URL protocol for this page is HTTPS, the sharing configuration will not take effect. So the link to the share should be changed to the HTTP protocol.
      3. This page must be a link to the domain name (cannot be IP, so development should pay attention to avoid stepping on the pit).
App configuration sharing
    1. Refer to scripts and how to use the same, if you do not need to share, you can delete jweixin-1.0.0.js and active.wxShare();
    2. In Android app, if sharing a picture size is too large, it may cause the problem of loading the picture to fail.
    3. When sharing to QQ, because the QQ version is different, may appear to share out is the picture and the text separates two messages the situation.
Depending on the platform, pull up the native job/company page or Web position/company page implementation
        var apitype = 0; Judge the environment if (!! Window.webkit &&!! Window.webkit.messageHandlers &&!! Window.webkit.messageHandlers.chinahr) {apitype = 2;//ios5.4.2+} else {if (!!  Window.chinahr) {apitype = 1; Andriod and iOS low version} else {apitype = 0;//non-app Environment}} if (Apitype!== 0)                {//app Environment $ (' a '). On (' click ', Function (e) {var] href = $ (this). attr (' href ');                E.preventdefault ();                    if (Href.indexof (' job ') >-1) {//position var id = href.split (' job/') [1].split ('. html ') [0];                    var message = "chinahr://customer/job?id=" + ID + "";                    if (Apitype = = 2) {window.webkit.messageHandlers.chinahr.postMessage (message);                    } else if (Apitype = = 1) {window.chinahr.gotoPage_callback (message, "");      }          } else if (Href.indexof (' company ') >-1) {//corporate var id = href.split (' Compa                    ny/') [1].split ('. html ') [0];                    var message = "chinahr://customer/company?id=" + ID + "";                    if (Apitype = = 2) {window.webkit.messageHandlers.chinahr.postMessage (message);                    } else if (Apitype = = 1) {window.chinahr.gotoPage_callback (message, "");        }                }            }); }

In-app WebView development Debug Debugging Method:
    1. Place the project on the server (local/test), replace the rule with the Fiddler, Charlse, and other grab tools, replacing any of the WebView page requests in the app with the page you want to test. Note: The HTTPS certificate needs to be installed on the mobile side to avoid the replacement rule failure, as described in:

      The Grab kit tool configures HTTPS.

    2. Put the project on the test server, find the mobile QA classmate to configure the app test environment, through the test package portal to enter the Web page.

Precautions:

    1. The app caches the WebView, can modify the version number, or clears the app cache.
    2. WebView Adaptive Viewport (viewport) scaling is problematic (can only be zoomed in and not scaled down), and it is not recommended to use the viewport scaling strategy for WebView page development.

Summary of mobile development experience

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.