Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/release/v1.0-beta.2'
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
  • Loading branch information
Benjamin Reimold committed Apr 28, 2015
2 parents 60ade06 + d354273 commit 806eb74
Show file tree
Hide file tree
Showing 287 changed files with 5,626 additions and 4,713 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ profile

documentation/
Products/
upload-to-hockey.sh
.gutter.json
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
language: objective-c
before_install:
- gem install xcpretty -N
- gem install xcpretty -N cocoapods
notifications:
slack:
secure: dCzA1+dtjKkHk2PK6RWBSE0Obgf0CvIejhXXH4Aba29zfVQg5Bv0yWJ34YHnPMFPA7+eyFrW2TqGqI7gA7L7Ju0RWHwu9Z0XayCcMpOCZVKTOSf/7SrAvtODKNzAT/S55HZOaj8yxK6l5a0cMGXfGM7j+NLdkjyba7ypQKsn0ug=
script:
- set -o pipefail
- cd Support
- xcodebuild -project AppInsights.xcodeproj -scheme "AppInsights" -sdk iphonesimulator
- xcodebuild -project ApplicationInsights.xcodeproj -scheme "ApplicationInsights" -sdk iphonesimulator
-configuration Debug -destination "platform=iOS Simulator,name=iPhone 6" test |
xcpretty -c
- xcodebuild -project AppInsights.xcodeproj -scheme "AppInsights Framework" -sdk iphonesimulator
- xcodebuild -project ApplicationInsights.xcodeproj -scheme "ApplicationInsights Framework" -sdk iphonesimulator
-configuration Release | xcpretty -c
- cd ..
- cp -R Products/ApplicationInsights ApplicationInsights
- pod lib lint
14 changes: 7 additions & 7 deletions ApplicationInsights.podspec
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Pod::Spec.new do |s|
s.name = "ApplicationInsights"
s.version = "1.0-beta.1"
s.version = "1.0-beta.2"
s.summary = "Microsoft Application Insights SDK for iOS"
s.description = <<-DESC
Application Insights is a service that allows developers to keep their applications available, performant, and successful.
This SDK will allow you to send telemetry of various kinds (event, trace, exception, etc.) and useful crash reports to the Application Insights service where they can be visualized in the Azure Portal.
DESC
s.homepage = "https://github.com/Microsoft/AppInsights-iOS/"
s.license = { :type => 'MIT', :file => 'AppInsights/LICENSE' }
s.homepage = "https://github.com/Microsoft/ApplicationInsights-iOS/"
s.license = { :type => 'MIT', :file => 'ApplicationInsights/LICENSE' }
s.author = { "Microsoft" => "appinsights-ios@microsoft.com" }

s.source = { :http => "https://github.com/Microsoft/AppInsights-iOS/releases/download/v#{s.version}/AppInsights-#{s.version}.zip" }
s.source = { :http => "https://github.com/Microsoft/ApplicationInsights-iOS/releases/download/v#{s.version}/ApplicationInsights-#{s.version}.zip" }

s.platform = :ios, '6.0'
s.requires_arc = true

s.frameworks = 'UIKit', 'Foundation', 'SystemConfiguration', 'Security'
s.frameworks = 'UIKit', 'Foundation', 'SystemConfiguration', 'Security', 'libz'
s.weak_framework = 'CoreTelephony'

s.ios.vendored_frameworks = 'AppInsights/AppInsights.framework'
s.preserve_path = 'AppInsights/README.md'
s.ios.vendored_frameworks = 'ApplicationInsights/ApplicationInsights.framework'
s.preserve_path = 'ApplicationInsights/README.md'
end
30 changes: 0 additions & 30 deletions Classes/AppInsightsPrivate.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,3 @@
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif

#if DEBUG
#define TLDebugLog(...) NSLog(__VA_ARGS__)
#else
#define TLDebugLog(...)
#endif
36 changes: 22 additions & 14 deletions Classes/AppInsights.h → Classes/ApplicationInsights.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
#ifndef MSAI_h
#define MSAI_h

#import "AppInsightsFeatureConfig.h"
#import "MSAIAppInsights.h"
// Define nullability fallback for backwards compatibility
#if !__has_feature(nullability)
#define NS_ASSUME_NONNULL_BEGIN
#define NS_ASSUME_NONNULL_END
#define nullable
#define nonnull
#define null_unspecified
#define null_resettable
#define __nullable
#define __nonnull
#define __null_unspecified
#endif

#import "ApplicationInsightsFeatureConfig.h"
#import "MSAIApplicationInsights.h"

#if MSAI_FEATURE_CRASH_REPORTER
#import "MSAICrashManager.h"
Expand All @@ -14,22 +27,15 @@
#if MSAI_FEATURE_TELEMETRY
#import "MSAICategoryContainer.h"
#import "MSAITelemetryManager.h"
#import "MSAIMetricsManager.h"

/**
* MSAIMetricsManager has been renamed to MSAITelemetryManager in 1.0-alpha.3. Please use this class instead.
*/
__attribute__((deprecated("Use MSAITelemetryManager instead")))
typedef MSAITelemetryManager MSAIMetricsManager;

#endif /* MSAI_FEATURE_TELEMETRY */

// Notification message which AppInsightsManager is listening to, to retry requesting updated from the server
// Notification message which MSAIApplicationInsights is listening to, to retry requesting updated from the server
#define MSAINetworkDidBecomeReachableNotification @"MSAINetworkDidBecomeReachable"

#define MSAI_BASE_URL @"https://dc.services.visualstudio.com"

#if MSAI_FEATURE_CRASH_REPORTER
NS_ASSUME_NONNULL_BEGIN
/**
* MSAI Crash Reporter error domain
*/
Expand All @@ -51,7 +57,7 @@ typedef NS_ENUM (NSInteger, MSAICrashErrorReason) {
*/
MSAICrashAPIErrorWithStatusCode
};
extern NSString *const __unused kMSAICrashErrorDomain;
FOUNDATION_EXPORT NSString *const __unused kMSAICrashErrorDomain;


/**
Expand All @@ -64,6 +70,8 @@ typedef NS_ENUM(NSInteger, MSAIErrorReason) {
MSAIErrorUnknown
};
extern NSString *const __unused kMSAIErrorDomain;
#endif
NS_ASSUME_NONNULL_END

#endif
#endif /* MSAI_FEATURE_CRASH_REPORTER */

#endif /* MSAI_h */
32 changes: 32 additions & 0 deletions Classes/ApplicationInsightsPrivate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#import <Foundation/Foundation.h>
#import "MSAIApplicationInsights.h"

NS_ASSUME_NONNULL_BEGIN
#ifndef MSAI_Private_h
#define MSAI_Private_h

FOUNDATION_EXPORT NSString *const kMSAIName;
FOUNDATION_EXPORT NSString *const kMSAIIdentifier;
FOUNDATION_EXPORT NSString *const kMSAICrashSettings;
FOUNDATION_EXPORT NSString *const kMSAICrashAnalyzer;

#if MSAI_FEATURE_TELEMETRY

FOUNDATION_EXPORT NSString *const __unused kMSAITelemetryCachesSessions;
FOUNDATION_EXPORT NSString *const __unused kMSAITelemetryTempSessionData;
FOUNDATION_EXPORT NSString *const __unused kMSAITelemetryLastAppVersion;

#endif /* MSAI_FEATURE_METRICS */

FOUNDATION_EXPORT NSString *const kMSAIIntegrationflowTimestamp;

FOUNDATION_EXPORT NSString *const kMSAITelemetryPath;

#define MSAILog(fmt, ...) do { if([MSAIApplicationInsights sharedInstance].isDebugLogEnabled && ![MSAIApplicationInsights sharedInstance].isAppStoreEnvironment) { NSLog((@"[MSAI] %s/%d " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); }} while(0)

#ifndef __IPHONE_8_0
#define __IPHONE_8_0 80000
#endif

#endif /* MSAI_Private_h */
NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "AppInsights.h"
#import "AppInsightsPrivate.h"
#import "ApplicationInsights.h"
#import "ApplicationInsightsPrivate.h"

NSString *const kMSAIName = @"AppInsights";
NSString *const kMSAIName = @"ApplicationInsights";
NSString *const kMSAIIdentifier = @"com.microsoft.applicationinsights.ios";
NSString *const kMSAICrashSettings = @"MSAICrashManager.plist";
NSString *const kMSAICrashAnalyzer = @"MSAICrashManager.analyzer";
Expand Down
59 changes: 36 additions & 23 deletions Classes/MSAIAppClient.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#import <Foundation/Foundation.h>

#import "MSAIHTTPOperation.h"

NS_ASSUME_NONNULL_BEGIN
/**
* Generic AppInsights API client
* Generic ApplicationInsights API client
*/
@interface MSAIAppClient : NSObject

/**
* designated initializer
*
* @param baseURL the baseURL of the AppInsights instance
* @param baseURL the baseURL of the ApplicationInsights instance
*/
- (instancetype) initWithBaseURL:(NSURL*) baseURL;
- (instancetype)initWithBaseURL:(NSURL*)baseURL;

/**
* baseURL to which relative paths are appended
Expand All @@ -29,9 +29,9 @@
*
* @return an NSMutableURLRequest for further configuration
*/
- (NSMutableURLRequest *) requestWithMethod:(NSString*) method
path:(NSString *) path
parameters:(NSDictionary *) params;
- (NSMutableURLRequest *)requestWithMethod:(NSString*)method
path:(nullable NSString *)path
parameters:(nullable NSDictionary *)params;
/**
* Creates an operation for the given NSURLRequest
*
Expand All @@ -40,8 +40,8 @@
*
* @return operation, which can be queued via enqueueHTTPOperation:
*/
- (MSAIHTTPOperation *) operationWithURLRequest:(NSURLRequest*) request
completion:(MSAINetworkCompletionBlock) completion;
- (MSAIHTTPOperation *) operationWithURLRequest:(NSURLRequest*)request
completion:(nullable MSAINetworkCompletionBlock)completion;

/**
* Creates an operation for the given path, and enqueues it
Expand All @@ -51,9 +51,9 @@
* @param completion completionBlock that is called once the operation finished
*
*/
- (void) getPath:(NSString*) path
parameters:(NSDictionary *) params
completion:(MSAINetworkCompletionBlock) completion;
- (void)getPath:(NSString*)path
parameters:(nullable NSDictionary *)params
completion:(nullable MSAINetworkCompletionBlock)completion;

/**
* Creates an operation for the given path, and enqueues it
Expand All @@ -63,26 +63,38 @@
* @param completion completionBlock that is called once the operation finished
*
*/
- (void) postPath:(NSString*) path
parameters:(NSDictionary *) params
completion:(MSAINetworkCompletionBlock) completion;
- (void)postPath:(NSString*)path
parameters:(nullable NSDictionary *)params
completion:(nullable MSAINetworkCompletionBlock)completion;
/**
* adds the given operation to the internal queue
*
* @param operation operation to add
*/
- (void) enqeueHTTPOperation:(MSAIHTTPOperation *) operation;
- (void)enqeueHTTPOperation:(MSAIHTTPOperation *)operation;

/**
* cancels the specified operations
*
* @param path the path which operation should be cancelled. Can be nil to match all
* @param method the method which operations to cancel. Can be nil to match all
* @param path the path which operation should be cancelled.
* @param method the method which operations to cancel.
*
* @return number of operations cancelled
*
* @see cancelAllOperations
*/
- (NSUInteger) cancelOperationsWithPath:(NSString*) path
method:(NSString*) method;
- (NSUInteger)cancelOperationsWithPath:(nullable NSString*)path
method:(nullable NSString*)method;

/**
* cancels all current operations
*
* @returns number of operations cancelled
*
* @see cancelOperationsWithPath:method
*/
- (NSUInteger)cancelAllOperations;

/**
* Access to the internal operation queue
*/
Expand All @@ -99,19 +111,20 @@
*
* @return NSData instance configured to be attached on a (post) URLRequest
*/
+ (NSData *)dataWithPostValue:(NSString *)value forKey:(NSString *)key boundary:(NSString *) boundary;
+ (NSData *)dataWithPostValue:(NSString *)value forKey:(NSString *)key boundary:(NSString *)boundary;

/**
* create a post body from the given value, key and boundary and content type.
*
* @param value -
* @param key -
*@param contentType -
* @param contentType -
* @param boundary -
* @param filename -
*
* @return NSData instance configured to be attached on a (post) URLRequest
*/
+ (NSData *)dataWithPostValue:(NSData *)value forKey:(NSString *)key contentType:(NSString *)contentType boundary:(NSString *) boundary filename:(NSString *)filename;
+ (NSData *)dataWithPostValue:(NSData *)value forKey:(NSString *)key contentType:(NSString *)contentType boundary:(NSString *)boundary filename:(null_unspecified NSString *)filename;

@end
NS_ASSUME_NONNULL_END
Loading

0 comments on commit 806eb74

Please sign in to comment.