<commit_before>AppInsight-for-iOS
==================

[Cafe moba for App Insight](http://appinsight.cafemoba.com) is a lightweight logging & tracking library that provides app developers a customizable way to access, analyze, and visualize the ways users interact with their apps

Installation
============

### From CocoaPods

If you don't have CocoaPods installed already, do

    [sudo] gem install cocoapods
    pod setup

then

    pod repo add cafemoba https://github.com/cafemoba/Specs.git
    cd AppInsightDemo
    pod install
    open AppInsightDemo.xcworkspace


* Add `pod AppInsight` to your Podfile.
* Add [cafemoba specs repo](https://github.com/cafemoba/Specs.git) by running `pod repo add cafemoba https://github.com/cafemoba/Specs.git` in Terminal
* Do `pod install`
* Add `#import <AppInsight/AppInsight.h>` to your _Prefix.pch_

### Manually

* Drag **AppInsight.framework** to your Frameworks grouping within XCode.
* Add `#import <AppInsight/AppInsight.h>` to your _Prefix.pch_

Sample Usage
============

You can see and play with sample log messages we have setup in the AppInsightDemo Xcode project. You'll need to register with [AppInsight](https://appinsight.cafemoba.com) and obtain API Key. After you do, replace the value of **AppInsight** key in _AppInsightDemo-Info.plist_.

You should be able to build and run the demo project in XCode simulator now.


Essentially there are three ways to log.

### Simple logging

For example, to log network status change with [AFNetworking](https://github.com/AFNetworking/AFNetworking) you would do something like:

    - (void)networkStatusChanged:(AFNetworkReachabilityStatus)status
    {
        switch (status) {
            case AFNetworkReachabilityStatusReachableViaWWAN:<commit_msg>Clarified the steps required to install AppInsight via CocoaPods and added the 'Registration' heading<commit_after>AppInsight-for-iOS
==================

[Cafe moba for App Insight](http://appinsight.cafemoba.com) is a lightweight logging & tracking library that provides app developers a customizable way to access, analyze, and visualize the ways users interact with their apps

Registration
============

Visit [https://appinsight.cafemoba.com](https://appinsight.cafemoba.com) and register an account. This will give you access to an API Key. You will need this later.

Installation
============

### From CocoaPods

If you don't have CocoaPods installed already (see [http://cocoapods.org/] (http://cocoapods.org/) for how to get started), do

    [sudo] gem install cocoapods
    pod setup

then perform the following steps:

* Add `pod AppInsight` and `pod AFNetworking` to your Podfile. The following is a sample Podfile that you can use:

```
platform :ios, '6.0'
pod 'AFNetworking', '= 1.3.1'
pod 'AppInsight',   '>= 0.0.8'
```

* Add [cafemoba specs repo](https://github.com/cafemoba/Specs.git) by running `pod repo add cafemoba https://github.com/cafemoba/Specs.git` in Terminal
* Do `pod install`
* Add `#import <AppInsight/AppInsight.h>` to your _Prefix.pch_
* Modify the project's Info.plist by adding a new key value pair of 'AppInsight' and the API Key provided upon registration. If you are trying out the AppInsightDemo then just change the value of the 'AppInsight' key.

### Manually

* Drag **AppInsight.framework** to your Frameworks grouping within XCode.
* Add `#import <AppInsight/AppInsight.h>` to your _Prefix.pch_
* Modify the project's Info.plist by adding a new key value pair of 'AppInsight' and the API Key provided upon registration. If you are trying out AppInsightDemo then just change the value of the 'AppInsight' key.

Sample Usage
============

You can see and play with sample log messages we have setup in the AppInsightDemo Xcode project. You'll need to register with [AppInsight](https://appinsight.cafemoba.com) and obtain API Key. After you do, replace the value of **AppInsight** key in _AppInsightDemo-Info.plist_.

You should be able to build and run the demo project in XCode simulator now.


Essentially there are three ways to log.

### Simple logging

For example, to log network status change with [AFNetworking](https://github.com/AFNetworking/AFNetworking) you would do something like:

    - (void)networkStatusChanged:(AFNetworkReachabilityStatus)status
    {
        switch (status) {
            case AFNetworkReachabilityStatusReachableViaWWAN:
{'fraction_non_alphanumeric': 0.10197066911090742, 'fraction_numerical': 0.0018331805682859762, 'mean_word_length': 4.5044136191677175, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 11, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5662538', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1269, 'n_words': 499}