Skip to content

Commit

Permalink
Merge pull request #22 from particle-iot/feature/update-afnetworking
Browse files Browse the repository at this point in the history
Feature/update afnetworking
  • Loading branch information
RaimundasSakalauskas authored Apr 27, 2020
2 parents 0064fe3 + 9c475f7 commit bee2b05
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 63 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
Particle iOS Cloud SDK adheres to [Semantic Versioning](http://semver.org/).

---
## [1.0.5](https://github.com/particle-iot/particle-cloud-sdk-ios/releases/tag/1.0.5) (2020-04-24)

* Update AFNetworking to 4.0 to fix AppStore error about usage of deprecated UIWebView

## [1.0.4](https://github.com/particle-iot/particle-cloud-sdk-ios/releases/tag/1.0.4) (2020-03-23)

* Add custom header to easier identify traffic coming from mobile SDK
Expand Down
8 changes: 4 additions & 4 deletions Particle-SDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Particle-SDK"
s.version = "1.0.4"
s.version = "1.0.5"
s.summary = "Particle iOS Cloud SDK for interacting with Particle powered devices"
s.description = <<-DESC
Particle iOS Cloud SDK Cocoapod library
Expand All @@ -14,21 +14,21 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/particle-iot/particle-cloud-sdk-ios.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/particle'

s.platform = :ios, '8.0'
s.platform = :ios, '9.0'
s.requires_arc = true

s.public_header_files = 'ParticleSDK/*.h'
s.source_files = 'ParticleSDK/*.h'

s.subspec 'Helpers' do |ss|
ss.source_files = 'ParticleSDK/Helpers/*.{h,m}'
ss.dependency 'AFNetworking', '~> 3.0'
ss.dependency 'AFNetworking', '~> 4.0'
ss.ios.frameworks = 'SystemConfiguration', 'Security'
end

s.subspec 'SDK' do |ss|
ss.source_files = 'ParticleSDK/SDK/Particle*.{h,m}'
ss.dependency 'AFNetworking', '~> 3.0'
ss.dependency 'AFNetworking', '~> 4.0'
ss.dependency 'Particle-SDK/Helpers'
end

Expand Down
10 changes: 6 additions & 4 deletions ParticleSDK/Helpers/EventSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,15 @@ - (void)close
return;
}

wasClosed = YES;

dispatch_after(DISPATCH_TIME_NOW, self.queue, ^(void) {
if (wasClosed) {
return;
}

[self.eventSource cancel];
self.queue = nil;
wasClosed = YES;
});

self.queue = nil;
}


Expand Down
56 changes: 29 additions & 27 deletions ParticleSDK/SDK/ParticleCloud.m

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions ParticleSDK/SDK/ParticleDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ -(NSURLSessionDataTask *)ping:(nullable void(^)(BOOL result, NSError* _Nullable

[self setAuthHeaderWithAccessToken];

NSURLSessionDataTask *task = [ParticleDevice.manager PUT:[url description] parameters:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSURLSessionDataTask *task = [ParticleDevice.manager PUT:[url description] parameters:nil headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
[ParticleLogger logInfo:NSStringFromClass([self class]) format:@"%@ (%i)", url.absoluteString, (int)((NSHTTPURLResponse *)task.response).statusCode];
[ParticleLogger logDebug:NSStringFromClass([self class]) format:@"%@", responseObject];

Expand Down Expand Up @@ -326,7 +326,7 @@ -(NSURLSessionDataTask *)getVariable:(NSString *)variableName completion:(nullab

[self setAuthHeaderWithAccessToken];

NSURLSessionDataTask *task = [ParticleDevice.manager GET:[url description] parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
NSURLSessionDataTask *task = [ParticleDevice.manager GET:[url description] parameters:nil headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
{
[ParticleLogger logInfo:NSStringFromClass([self class]) format:@"%@ (%i)", url.absoluteString, (int)((NSHTTPURLResponse *)task.response).statusCode];
[ParticleLogger logDebug:NSStringFromClass([self class]) format:@"%@", responseObject];
Expand Down Expand Up @@ -392,7 +392,7 @@ -(NSURLSessionDataTask *)callFunction:(NSString *)functionName

[self setAuthHeaderWithAccessToken];

NSURLSessionDataTask *task = [ParticleDevice.manager POST:[url description] parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
NSURLSessionDataTask *task = [ParticleDevice.manager POST:[url description] parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
{
[ParticleLogger logInfo:NSStringFromClass([self class]) format:@"%@ (%i)", url.absoluteString, (int)((NSHTTPURLResponse *)task.response).statusCode];
[ParticleLogger logDebug:NSStringFromClass([self class]) format:@"%@", responseObject];
Expand Down Expand Up @@ -439,7 +439,7 @@ -(NSURLSessionDataTask *)signal:(BOOL)enable completion:(nullable ParticleComple

[self setAuthHeaderWithAccessToken];

NSURLSessionDataTask *task = [ParticleDevice.manager PUT:[url description] parameters:params success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSURLSessionDataTask *task = [ParticleDevice.manager PUT:[url description] parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
[ParticleLogger logInfo:NSStringFromClass([self class]) format:@"%@ (%i)", url.absoluteString, (int)((NSHTTPURLResponse *)task.response).statusCode];
[ParticleLogger logDebug:NSStringFromClass([self class]) format:@"%@", responseObject];

Expand Down Expand Up @@ -470,7 +470,7 @@ -(NSURLSessionDataTask *)unclaim:(nullable ParticleCompletionBlock)completion

[self setAuthHeaderWithAccessToken];

NSURLSessionDataTask *task = [ParticleDevice.manager DELETE:[url description] parameters:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
NSURLSessionDataTask *task = [ParticleDevice.manager DELETE:[url description] parameters:nil headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
{
[ParticleLogger logInfo:NSStringFromClass([self class]) format:@"%@ (%i)", url.absoluteString, (int)((NSHTTPURLResponse *)task.response).statusCode];
[ParticleLogger logDebug:NSStringFromClass([self class]) format:@"%@", responseObject];
Expand Down Expand Up @@ -519,7 +519,7 @@ -(NSURLSessionDataTask *)rename:(NSString *)newName completion:(nullable Particl

[self setAuthHeaderWithAccessToken];

NSURLSessionDataTask *task = [ParticleDevice.manager PUT:[url description] parameters:params success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSURLSessionDataTask *task = [ParticleDevice.manager PUT:[url description] parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
[ParticleLogger logInfo:NSStringFromClass([self class]) format:@"%@ (%i)", url.absoluteString, (int)((NSHTTPURLResponse *)task.response).statusCode];
[ParticleLogger logDebug:NSStringFromClass([self class]) format:@"%@", responseObject];

Expand Down Expand Up @@ -553,7 +553,7 @@ -(NSURLSessionDataTask *)setNotes:(NSString *)notes completion:(nullable Particl

[self setAuthHeaderWithAccessToken];

NSURLSessionDataTask *task = [ParticleDevice.manager PUT:[url description] parameters:params success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSURLSessionDataTask *task = [ParticleDevice.manager PUT:[url description] parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
[ParticleLogger logInfo:NSStringFromClass([self class]) format:@"%@ (%i)", url.absoluteString, (int)((NSHTTPURLResponse *)task.response).statusCode];
[ParticleLogger logDebug:NSStringFromClass([self class]) format:@"%@", responseObject];

Expand Down Expand Up @@ -638,7 +638,7 @@ -(NSURLSessionDataTask *)flashKnownApp:(NSString *)knownAppName completion:(null

[self setAuthHeaderWithAccessToken];

NSURLSessionDataTask *task = [ParticleDevice.manager PUT:[url description] parameters:params success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
NSURLSessionDataTask *task = [ParticleDevice.manager PUT:[url description] parameters:params headers:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
{
[ParticleLogger logInfo:NSStringFromClass([self class]) format:@"%@ (%i)", url.absoluteString, (int)((NSHTTPURLResponse *)task.response).statusCode];
[ParticleLogger logDebug:NSStringFromClass([self class]) format:@"%@", responseObject];
Expand Down Expand Up @@ -775,7 +775,7 @@ -(NSURLSessionDataTask *)getCurrentDataUsage:(nullable void(^)(float dataUsed, N

[self setAuthHeaderWithAccessToken];

NSURLSessionDataTask *task = [ParticleDevice.manager GET:[url description] parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
NSURLSessionDataTask *task = [ParticleDevice.manager GET:[url description] parameters:nil headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
{
[ParticleLogger logInfo:NSStringFromClass([self class]) format:@"%@ (%i)", url.absoluteString, (int)((NSHTTPURLResponse *)task.response).statusCode];
[ParticleLogger logDebug:NSStringFromClass([self class]) format:@"%@", responseObject];
Expand Down
13 changes: 2 additions & 11 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
source 'https://cdn.cocoapods.org/'


platform :ios, '8.0'
platform :ios, '9.0'

target 'ParticleSDKPods' do
pod 'AFNetworking/NSURLSession'
pod 'AFNetworking', '~> 4.0'

target 'ParticleSDKTests' do
pod 'OHHTTPStubs/Swift'
end
end


post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
end
end
end
24 changes: 16 additions & 8 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
PODS:
- AFNetworking/NSURLSession (3.2.1):
- AFNetworking (4.0.0):
- AFNetworking/NSURLSession (= 4.0.0)
- AFNetworking/Reachability (= 4.0.0)
- AFNetworking/Security (= 4.0.0)
- AFNetworking/Serialization (= 4.0.0)
- AFNetworking/UIKit (= 4.0.0)
- AFNetworking/NSURLSession (4.0.0):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (3.2.1)
- AFNetworking/Security (3.2.1)
- AFNetworking/Serialization (3.2.1)
- AFNetworking/Reachability (4.0.0)
- AFNetworking/Security (4.0.0)
- AFNetworking/Serialization (4.0.0)
- AFNetworking/UIKit (4.0.0):
- AFNetworking/NSURLSession
- OHHTTPStubs/Core (8.0.0)
- OHHTTPStubs/Default (8.0.0):
- OHHTTPStubs/Core
Expand All @@ -21,7 +29,7 @@ PODS:
- OHHTTPStubs/Default

DEPENDENCIES:
- AFNetworking/NSURLSession
- AFNetworking (~> 4.0)
- OHHTTPStubs/Swift

SPEC REPOS:
Expand All @@ -30,9 +38,9 @@ SPEC REPOS:
- OHHTTPStubs

SPEC CHECKSUMS:
AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
AFNetworking: d9fdf484a3c723ec3c558a41cc5754c7e845ee77
OHHTTPStubs: 9cbce6364bec557cc3439aa6bb7514670d780881

PODFILE CHECKSUM: 7860238827a698a5fe8d564cb12f57b58fc30512
PODFILE CHECKSUM: 84a10556255b654e3cc59f3a7c760f5b81dfdb92

COCOAPODS: 1.8.4
COCOAPODS: 1.9.1

0 comments on commit bee2b05

Please sign in to comment.