Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

Commit

Permalink
fix: being compatible with the latest SDK
Browse files Browse the repository at this point in the history
close #68
  • Loading branch information
zapcannon87 committed Nov 18, 2019
1 parent fc35695 commit 1ecc383
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 32 deletions.
2 changes: 1 addition & 1 deletion LeanCloudFeedback.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |s|

s.name = "LeanCloudFeedback"
s.version = "0.1.0"
s.platform = :ios, "6.0"
s.platform = :ios, "8.0"
s.summary = "LeanCloud iOS SDK for mobile backend."
s.homepage = "https://leancloud.cn"
s.documentation_url = "https://leancloud.cn/docs/feedback.html"
Expand Down
15 changes: 10 additions & 5 deletions LeanCloudFeedback.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
5CCAE0F21B09B0FE009276B9 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
LastUpgradeCheck = 1120;
ORGANIZATIONNAME = LeanCloud;
TargetAttributes = {
5CC504C71B0EFCBA004D0CB1 = {
Expand All @@ -248,6 +248,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
"zh-Hans",
);
Expand Down Expand Up @@ -378,12 +379,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -412,7 +415,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -435,12 +438,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand All @@ -462,7 +467,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -477,7 +482,7 @@
baseConfigurationReference = D94FDB034BF527C80C647B30 /* Pods-LeanCloudFeedback.debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -503,7 +508,7 @@
baseConfigurationReference = 59AC16570E133BA472B3DABB /* Pods-LeanCloudFeedback.release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand Down
4 changes: 3 additions & 1 deletion LeanCloudFeedback/LCHttpClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ - (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)p
NSURL *url = [NSURL URLWithString:path];

if (!url.scheme.length) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSString *URLString = [[LCRouter sharedInstance] URLStringForPath:path];
#pragma clang diagnostic pop
url = [NSURL URLWithString:URLString];
}

Expand All @@ -65,7 +68,6 @@ - (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)p
[request setValue:[AVUser currentUser].sessionToken forHTTPHeaderField:@"X-LC-Session"];
}

[request setTimeoutInterval:kAVDefaultNetworkTimeoutInterval];
[request setHTTPMethod:method];
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"DELETE"]) {
url = [NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:@"?%@", [self queryStringFromParameters:parameters]]];
Expand Down
24 changes: 12 additions & 12 deletions LeanCloudFeedback/LCUserFeedbackViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ - (void)fetchRepliesWithBlock:(AVArrayResultBlock)block {
block(nil, error);
} else {
if (feedback) {
_userFeedback = feedback;
self->_userFeedback = feedback;
if (self.contact == nil) {
self.contact = feedback.contact;
}
[_userFeedback fetchFeedbackRepliesInBackgroundWithBlock:block];
[self->_userFeedback fetchFeedbackRepliesInBackgroundWithBlock:block];
} else {
block([NSArray array], nil);
}
Expand All @@ -228,13 +228,13 @@ - (void)loadFeedbackThreads {
[_refreshControl beginRefreshing];
}
[self fetchRepliesWithBlock:^(NSArray *objects, NSError *error) {
[_refreshControl endRefreshing];
[self->_refreshControl endRefreshing];
if ([self filterError:error]) {
if (objects.count > 0) {
[_feedbackReplies removeAllObjects];
[_feedbackReplies addObjectsFromArray:objects];
[self->_feedbackReplies removeAllObjects];
[self->_feedbackReplies addObjectsFromArray:objects];

[_tableView reloadData];
[self->_tableView reloadData];
[self scrollToBottom];
}
}
Expand Down Expand Up @@ -313,7 +313,7 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
if ([self filterError:error]) {
LCUserFeedbackReply *feedbackReply = [LCUserFeedbackReply feedbackReplyWithAttachment:attachment.url type:LCReplyTypeUser];
feedbackReply.attachmentImage = originImage;
[self saveFeedbackReply:feedbackReply AtFeedback:_userFeedback];
[self saveFeedbackReply:feedbackReply AtFeedback:self->_userFeedback];
}
}];
}
Expand All @@ -340,7 +340,7 @@ - (void)prepareFeedbackWithBlock:(AVBooleanResultBlock)block {
if (error) {
block(NO, error);
} else {
_userFeedback = object;
self->_userFeedback = object;
block(YES, nil);
}
}];
Expand All @@ -354,7 +354,7 @@ - (void)sendButtonClicked:(id)sender {
[self prepareFeedbackWithBlock:^(BOOL succeeded, NSError *error) {
if ([self filterError:error]) {
LCUserFeedbackReply *feedbackReply = [LCUserFeedbackReply feedbackReplyWithContent:content type:LCReplyTypeUser];
[self saveFeedbackReply:feedbackReply AtFeedback:_userFeedback];
[self saveFeedbackReply:feedbackReply AtFeedback:self->_userFeedback];
} else {
self.sendButton.enabled = YES;
}
Expand All @@ -365,12 +365,12 @@ - (void)sendButtonClicked:(id)sender {
- (void)saveFeedbackReply:(LCUserFeedbackReply *)feedbackReply AtFeedback:(LCUserFeedbackThread *)feedback {
[_userFeedback saveFeedbackReplyInBackground:feedbackReply withBlock:^(id object, NSError *error) {
if ([self filterError:error]) {
[_feedbackReplies addObject:feedbackReply];
[self->_feedbackReplies addObject:feedbackReply];
[self.tableView reloadData];
[self scrollToBottom];

if ([_inputTextField.text length] > 0) {
_inputTextField.text = @"";
if ([self->_inputTextField.text length] > 0) {
self->_inputTextField.text = @"";
}
}
self.sendButton.enabled = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
5CC504D91B0F01D3004D0CB1 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
LastUpgradeCheck = 1120;
ORGANIZATIONNAME = LeanCloud;
TargetAttributes = {
5CC504E01B0F01D3004D0CB1 = {
Expand All @@ -164,6 +164,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -281,6 +282,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -289,12 +291,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -333,6 +337,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -341,12 +346,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down
2 changes: 1 addition & 1 deletion LeanCloudFeedbackDemo/LeanCloudFeedbackDemo/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
#warning 用公共账号登录 https://leancloud.cn ,账号/密码:leancloud@163.com/Public123 即可查看用户反馈
NSString *appId = @"sl9sxfb9d9x0sc5g8c5wsv00f4nvztrgo5qcx4i4sjk1myn3";
NSString *appKey = @"ysz2l1zttl802m3qq8lvvqnmw8tnp4wiiuwe5xtydcjxrwtg";
[AVOSCloud setApplicationId:appId clientKey:appKey];
[AVOSCloud setApplicationId:appId clientKey:appKey serverURLString:@"https://sl9sxfb9.lc-cn-n1-shared.com"];

[AVOSCloud setAllLogsEnabled:YES];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
Expand Down Expand Up @@ -35,6 +45,11 @@
"idiom" : "iphone",
"filename" : "icon_60@3x.png",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
6 changes: 2 additions & 4 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ platform :ios, '8.0'
workspace 'LeanCloudFeedback.xcworkspace'

target 'LeanCloudFeedback' do
inhibit_all_warnings!
project 'LeanCloudFeedback.xcodeproj'
pod 'AVOSCloud', '11.4.9'
pod 'AVOSCloud'
end

target 'LeanCloudFeedbackDemo' do
inhibit_all_warnings!
project 'LeanCloudFeedbackDemo/LeanCloudFeedbackDemo.xcodeproj'
pod 'AVOSCloud', '11.4.9'
pod 'AVOSCloud'
pod 'LeanCloudFeedback', :path => '.'
end
14 changes: 7 additions & 7 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
PODS:
- AVOSCloud (11.4.9)
- AVOSCloud (12.0.4)
- LeanCloudFeedback (0.1.0):
- AVOSCloud

DEPENDENCIES:
- AVOSCloud (= 11.4.9)
- AVOSCloud
- LeanCloudFeedback (from `.`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
trunk:
- AVOSCloud

EXTERNAL SOURCES:
LeanCloudFeedback:
:path: "."

SPEC CHECKSUMS:
AVOSCloud: 1ad969db6e24c41ae1788d68698255d853883069
LeanCloudFeedback: 011993aef4d90ad52279339f607a0850787493dc
AVOSCloud: 6a3dd184e94a61caf3c8504e90172340a04798dd
LeanCloudFeedback: 475a2cf99385a23cc7818116b81fb7c781b79ce0

PODFILE CHECKSUM: f5177a5d9caf9a505bdec765c494d12d0656351f
PODFILE CHECKSUM: b0677fc747183471f9d653b377e73db854e607f5

COCOAPODS: 1.6.0.beta.2
COCOAPODS: 1.8.4

0 comments on commit 1ecc383

Please sign in to comment.