Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios share to snapchat can not open #75

Open
FJL522 opened this issue Jan 29, 2023 · 0 comments
Open

ios share to snapchat can not open #75

FJL522 opened this issue Jan 29, 2023 · 0 comments

Comments

@FJL522
Copy link

FJL522 commented Jan 29, 2023

take my Client ID and bundle id to demo,can open snapchat.
but take demo code to new project and client,can not open snapchat
i want wo kown how can i setting ?it will be work.

-(void)initShare{
[SCSDKSnapKit initSDK];
_scSdkAnapApi = [SCSDKSnapAPI new];
isShareing = false;
}

-(void)share:(UG_ShareData *)shareParams type:(NSInteger)type{
[self initShare];
if(isShareing)
{
return;
}
if (type == shareEventType_Img)
{
NSLog(@"SnapChatShare=1");
[self shareImg:shareParams];
}else if(type == shareEventType_Video)
{
[self shareVideo:shareParams];
}else{
NSLog(@"share=======未开发的分享类型");
}
}

-(void)shareImg:(UG_ShareData *)shareParams{
// NSString *contentType = @"image";
UIImage *snapImage = [UIImage imageWithContentsOfFile:shareParams.imgPath];
if (snapImage == NULL) {
NSLog(@"SnapChatShare=2");
[[UG_ShareManager sharedInstance] onShareResult: shareReCode_Fail];
return;
}
isShareing = true;
NSLog(@"SnapChatShare=3");
SCSDKSnapPhoto *photo = [[SCSDKSnapPhoto alloc] initWithImage:snapImage];
SCSDKPhotoSnapContent photoContent = [[SCSDKPhotoSnapContent alloc] initWithSnapPhoto:photo];
NSLog(@"SnapChatShare=4");
[_scSdkAnapApi startSendingContent:photoContent completionHandler:^(NSError
error){
isShareing = false;
NSLog(@"SnapChatShare:@%ld",error.code);
if(error.code ==0)
{
NSLog(@"SnapChatShare=5");
[[UG_ShareManager sharedInstance] onShareResult: shareReCode_Suc];
}else{
NSLog(@"SnapChatShare=6");
[[UG_ShareManager sharedInstance] onShareResult: shareReCode_Fail];
}
}];
}

log shows "SnapChatShare=4" later,it will be no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant