Skip to content

Instantly share code, notes, and snippets.

View iShawnWang's full-sized avatar
🤗
2333

Shawn Wang iShawnWang

🤗
2333
View GitHub Profile
@iShawnWang
iShawnWang / analytics.js
Created August 5, 2021 06:27 — forked from zmmbreeze/analytics.js
GA的源码 analytics.js
(function() {
/**
* 记录方法使用情况的类
* @param {Array.<boolean>} umMap 初始的使用情况
*/
var UsageManager = function(umMap) {
this.umMap = umMap || [];
};
/**
* 记录新的使用情况

###Note Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

###[UPDATE : Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.]

###[UPDATE 2:The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead]

##[UPDATE 3: For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached]