Jason


  • Categories

  • Search

In-App Purchase Helper

Posted on 2016-08-26 | In Cocoa

What’s IAPHelper

IAPHelper simply wraps the API of Apple’s In-App Purchase using Swift. Very lightweight and easy to use.

IAPHelper opens source and welcome to improve it.

IAPHelper Usage

Request Product List

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var productIdentifiers = Set<ProductIdentifier>()
productIdentifiers.insert("product_id_1")
productIdentifiers.insert("product_id_2")
IAP.requestProducts(productIdentifiers) { (response, error) in
if let products = response?.products where !products.isEmpty {
// Get the valid products
} else if let invalidProductIdentifiers = response?.invalidProductIdentifiers {
// Some products id are invalid
} else if error?.code == SKErrorPaymentCancelled {
// User cancelled
} else {
// Some error happened
}
}
Read more »

iptables

Posted on 2016-07-16 | In IT

How iptables Works

iptables works by matching each packet that crosses the networking interface against a set of rules (grouped by chains) to decide what to do (called target).

rules

The iptables firewall operates by comparing network traffic against a set of rules. The rules define the characteristics that a packet must have to match the rule, and the action that should be taken for matching packets.

chains

These rules are organized into groups called chains. A chain is a set of rules that a packet is checked against sequentially. When the packet matches one of the rules, it executes the associated action and is not checked against the remaining rules in the chain.
A user can create chains as needed. There are three chains defined by default. They are:
· INPUT: This chain handles all packets that are addressed to your server.
· OUTPUT: This chain contains rules for traffic created by your server.
· FORWARD: This chain is used to deal with traffic destined for other servers that are not created on your server.

Read more »

Google Analytics for Mac

Posted on 2016-05-13 | In Cocoa

07:34:46 AM

MacGoogleAnalytics is an open source library to use Google Analytics on Mac OS X.

Introduction

As we know, Google Analytics is perfect for user data collection and analytics. But unfortunately, there’s no official SDK for Mac OS X.

But still, there’re several ways to use Google Analytics on Mac OS X. MacGoogleAnalytics may be what you found.

Overall, there’re 2 parts work together to use Google Analytics.

  • HTML File

    • This is the real place to send data to Google Analytics server. It uses Google Analytics’s standard JavaScript API.
  • Mac OS X Part

    • In Mac OS X side, it loads the html file just mentioned. Send data like event to the html file as parameters. And then these data will be send in the html file through the JavaScript API.
Read more »
12…4
Jason

Jason

Digital Nomad, Mac Developer

12 posts
2 categories
RSS
GitHub Twitter
Links
  • Toolinbox
© 2011 - 2019 Jason