GithubHelp home page GithubHelp logo

line / line-sdk-ios-swift Goto Github PK

View Code? Open in Web Editor NEW
837.0 30.0 93.0 3.17 MB

Provides a modern way of implementing LINE APIs.

Home Page: https://developers.line.biz/

License: Apache License 2.0

Ruby 0.56% Swift 90.00% Objective-C 3.41% Shell 0.04% JavaScript 4.42% SCSS 1.10% Mustache 0.47%
line line-sdk line-login swift

line-sdk-ios-swift's Introduction

LINE SDK CI CocoaPods Compatible Swift Package Manager Compatible Carthage Compatible

LINE SDK for iOS Swift

Overview

Developed in Swift, the LINE SDK for iOS Swift provides a modern way of implementing LINE APIs. The features included in this SDK will help you develop an iOS app with engaging and personalized user experience.

Features

The LINE SDK for iOS Swift provides the following features.

User authentication

This feature allows users to log in to your service with their LINE accounts. With the help of the LINE SDK for iOS Swift, it has never been easier to integrate LINE Login into your app. Your users will automatically log in to your app without entering their LINE credentials if they are already logged in to LINE on their iOS devices. This offers a great way for users to get started with your app without having to go through a registration process.

Utilizing user data with OpenID support

Once the user authorizes, you can get the user’s LINE profile. You can utilize the user's information registered in LINE without building your user system.

The LINE SDK supports the OpenID Connect 1.0 specification. You can get ID tokens that contain the user’s LINE profile when you retrieve the access token.

Using the SDK

Prerequisites

  • iOS 13.0 or later as the deployment target.
  • Xcode 14.1 or later.

To use the LINE SDK with your iOS app, follow the steps below.

  • Create a channel.
  • Integrate LINE Login into your iOS app using the SDK.
  • Make API calls from your app using the SDK or from the server side through the Social API.

For more information, refer to the LINE SDK for iOS Swift guide on the LINE Developers site.

Trying the starter app

To have a quick look at the features of the LINE SDK, try our starter app by following the steps below:

  1. Clone the repository.

    git clone https://github.com/line/line-sdk-ios-swift.git

  2. Open the LineSDK.xcworkspace file in Xcode.

  3. Build and run the LineSDKSample scheme.

The starter app should launch.

Contributing

If you believe you have discovered a vulnerability or have an issue related to security, please DO NOT open a public issue. Instead, send us a mail to [email protected].

For contributing to this project, please see CONTRIBUTING.md.

line-sdk-ios-swift's People

Contributors

cherenkov avatar citynight avatar coffeephile avatar crazyleaf9999 avatar dlackty avatar ejameslin avatar kwline avatar m-yazaki-line avatar mrfour0004 avatar mrmaakun avatar onevcat avatar smwilk avatar susaseriz avatar thii avatar wouter-veeken avatar xiao99xiao avatar z6wdc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

line-sdk-ios-swift's Issues

Cannot find 'LoginManager' in scope

Is it a security issue?

If you believe you have discovered a vulnerability or have an issue related to security, please DO NOT open a public issue. Instead, send us a mail to [email protected].

What did you do?

Screenshot 2022-06-03 at 14 16 52

Screenshot 2022-06-03 at 14 16 47

Please describe what you did before you encounter the issue.

What did you expect?

Please describe what you did expect to happen.

What happened actually?

Displaying error Cannot find 'LoginManager' in scope

Please describe what happened actually.

Your environment?

  • XCode 13.3
  • Swift

Some information of the environment in which the issue happened. LINE SDK version, Xcode version, iOS version, etc.

Sample project

It would be appreciated if you can provide a link to or update a sample project that we can download and reproduce the issue.

Login with UniversalLinkFlow auto direct Safari browser

Hello, I'm applying Line login flow, but when I tried to call Login with UniversalLinkFlow when the Line app was installed before without login, when the Line App opened then auto-directed to the Safari browser.

  • So In this case how to configure to Line app to keep that session without directing it to the browser?
  • I have referred to another app like TikTok when logging Line no login yet, but the Line app still keeps that session.
  • I also tried the example on Line SDK, whose behavior is still directed to the browser.

Cannot build on Xcode 12 beta for simulators

Is it a security issue?

No

What did you do?

What did you expect?

What happened actually?

With Build Active Architecture Only set to NO, building for any simulator fails at the stage "Compile Swift source files (arm64)". While it works fine when building for physical devices.

import LineSDK

class LineAuthenticationSession {
    typealias LineAPI = LineSDK.API // error: No type named 'API' in module 'LineSDK'

    func isTokenError(_ error: LineSDKError) -> Bool { // error: Cannot find type 'LineSDKError' in scope
    }

    func login() {
        LoginManager.shared.login(permissions: [.profile]) { _ in  // error: Cannot find 'LoginManager' in scope
        }
    }
}

Your environment?

  • LINE SDK version: 5.5.1
  • SDK installation method: add xcframework manually
  • Xcode version: Xcode 12.0 beta 5 (12A8189h) and previous beta versions

Sample project

N/A

[Task] Refactoring post login networking part

It is a bit complicated right now. Maybe it would be a good idea to create some promising helps to handle the networking request better. They are not required to be so generic but should focus on the Request context. Some basic idea includes Chained and Zipped.

Error when using LineSDK in OC project

Is it a security issue?

no

What did you do?

After I integrate LineSDK with pods, I get an error when calling loginWithPermissions:permissions method

What did you expect?

I hope I can use LineSDK normally in OC projects

What happened actually?

error,EXC_BAD_ACCESS

Your environment?

pod 'LineSDKSwift/ObjC', '~> 5.0'

Xcode 12.0 beta 5

iOS 12.4.8

Sample project

https://github.com/hw20101101/H200914_Test_Protocol

WX20200919-180001@2x

跳转line app 授权失败,使用web授权成功

SDK 版本:5.8.2
line app版本:13.6.0

安装line app后,唤起line app授权,返回错误:authorizeFailed(reason: LineSDK.LineSDKError.AuthorizeErrorReason.userCancelled)

不安装line app,使用web授权没问题

Can I use this SDK on iOS8.0?

If I want to use the line login before iOS 10.0, do I have to use the previous SDK?

Look forward to your suggestions, thx.

PrivacyInfo.xcprivacy questions on ios 12

안녕하세요. Line SDK 사용 중에 문의 사항이 있습니다.

Line SDK 5.7.0 버전을 사용하고 있으며 5.11.0 버전부터 Apple의 Privacy Manifest 대응이 되는 것으로 확인하였습니다.
우리의 환경은 최소 iOS 12부터 지원하기 때문에 iOS 13부터 지원하는 5.11.0을 사용할 수 없습니다.
그래서 5.7.0을 그대로 사용하기를 희망합니다.

질문.

  1. 5.11.0의 Privacy Manifest 파일을 5.7.0에서 사용해도 문제가 없을지 궁금합니다. 5.7.0의 "LineSDKUI.bundle/PrivacyInfo.xcprivacy" 위치에 포함하려고 합니다.
  2. 5.7.0과 5.11.0의 버전 차이로 Privacy Manifest 내용에 변경이 필요한 부분이 있을지 궁금합니다.

감사합니다.

=====

Hello. I have a question while using the Line SDK.

We are using the Line SDK version 5.7.0, and we have confirmed that Apple's Privacy Manifest correspondence from version 5.11.0.
Since our environment supports iOS 12 at least, 5.11.0 that supports iOS 13 is not available.
So I hope to use 5.7.0 as it is.

Question.

  1. I'm wondering if the Privacy Manifest file in 5.11.0 is okay with using it in 5.7.0. I'm trying to include it in the "LineSDKUI.bundle/PrivacyInfo.xcprivacy" location in 5.7.0.
  2. I wonder if there is anything that needs to be changed in the Privacy Manifest content due to the difference in versions between 5.7.0 and 5.11.0.

Thank you.

ld: symbol(s) not found for architecture arm64

What did you do?

  • When I build my app I get the error ld: symbol(s) not found for architecture arm64 on file OpenChatCreatingController and ShareViewController with cause not found _swift_stdlib_isStackAllocationSafe

What did you expect?

Build with arm64 successfully

What happened actually?

[ Please describe what happened actually.](ld: symbol(s) not found for architecture arm64)

Your environment?

Some information of the environment in which the issue happened. LINE SDK version, Xcode version, iOS version, etc.

  • LineSDKSwift (5.8.1):
  • Xcode 14.2
    Build version 14C18

how to get "id_token" in lineSDKObjC ?

how to get "id_token" in lineSDKObjC?

请问一下,哥,如何在lineSDKObjC的SDK里面获取LineSDKAccessToken的json字符串中id_token字段(当权限允许openID),我看LineSDKAccessToken的结构里面没有哇,谢谢大哥。

登录不上,需要VPN?

Is it a security issue?

If you believe you have discovered a vulnerability or have an issue related to security, please DO NOT open a public issue. Instead, send us a mail to [email protected].

What did you do?

Please describe what you did before you encounter the issue.

What did you expect?

Please describe what you did expect to happen.

What happened actually?

Please describe what happened actually.

Your environment?

Some information of the environment in which the issue happened. LINE SDK version, Xcode version, iOS version, etc.

Sample project

It would be appreciated if you can provide a link to or update a sample project that we can download and reproduce the issue.

ios版本的怎么分享图片呢?

安卓使用安卓自己的方式分享图片是可以 的,但ios怎么解决呢。代码如下:
//图片分享
@objc static func shareWithLineWithUrlStr(urlStr: String) {
//Share image
let pasteboard = UIPasteboard.general
pasteboard.setData(UIImage(named: urlStr)!.jpegData(compressionQuality: 1.0)!, forPasteboardType: "public.jpeg")
let contentType = "image"
let urlString = "line:msg/(contentType)/(pasteboard.name)" // Get image from pasteboard, you can also use this method to share text
let url = URL(string: urlString)!
print(url)

    if UIApplication.shared.canOpenURL(url) {
        UIApplication.shared.open(url, options: [:], completionHandler: nil)
    } else {
        print("分享失败")
    }
}

app崩溃了,求大神解决

ios login open a new url

hello. My app use "react-native-line" to archive line login feature. It works well In android. But In IOS, after show authorize page, it will open another authorize page which url is ""access.line.me"(in line app).

image

I have asked the develper, and they replied that this is default of Line.

So I create a issue here, and want to know is this default ?

if not , how can I skip the page?

Internal API for `APIErrorDetail`

We could not access the error status code because it’s internal API.
but guide doc is the description that it can access.

case .failure(let error):
    if case .responseFailed(
        reason: .invalidHTTPStatusAPIError(let detail)) = error
    {
        if detail.code == 500 { // code is an internal API.
            print("LINE API Server Error: \(String(describing: detail.error)")
        } else if detail.code == 403 {
            print("Not enough permission. Login again with required permissions?")
            // Do Login
        }
    }

LINE Login verification screen shows provider name instead of app name

Not sure if it's iOS SDK issue or not, but when verifying login permissions in LINE app, the Important section shows the provider name in its text instead of the app name, e.g:

img_6836

In this example, Learn21 is the app name, and HEADSTART EDUCATION MANAGEMENT COMPANY LIMITED is the provider. It looks weird to read about downloading a company. :)

SDK Version 5.0.0 auth timeout in not wifi status

What did you do?

open SFSafariViewController in line (url: access.line.me) and timeout (wifi status is okay)

What did you expect?

in LTE or 3G status is also okay

What happened actually?

open SFSafariViewController in line (url: access.line.me) and timeout (wifi status is okay)

Your environment?

LINE SDK version 5.0.1, Xcode version 10.1, iOS version 12.1, iPhone X.

Xcode 13 beta 4 build issues

These problems were not exist in Xcode 13 beta 3.
My environment is Xcode 13 beta 4.
LineSDK version is 5.7.0

截圖 2021-08-04 10 52 56
截圖 2021-08-04 10 53 18
截圖 2021-08-04 10 53 45

the guide message is displayed by Japanese on confirm page.

What did you do?

I Integrated login codes followed guide on the LINE Developers site. and I did the test for login with LINE. After allowing the permission, the page was redirected to confirm page.


What did you expect?

the guide message is displayed by iOS device language on confirm page.


What happened actually?

the guide message is displayed by the Japanese on confirm page.
"このアプリを開きますか?"

image

Regardless of the device language, that message is always displayed in Japanese.


Your environment?

Line SDK version : 5.0.1
Xcode version: 10.1
iOS version: 12.1
iOS Language : English
iOS Region: United States


Sample project

This bug occurs in LineSDKSample.

typo in source code comments

Source code:

/// The Arabic langauge.
public static let arabic = WebPageLanguage(rawValue: "ar")
/// The German langauge.
public static let german = WebPageLanguage(rawValue: "de")
/// The English langauge.
public static let english = WebPageLanguage(rawValue: "en")
/// The Spanish langauge.
public static let spanish = WebPageLanguage(rawValue: "es")
/// The French langauge.
public static let french = WebPageLanguage(rawValue: "fr")
/// The Indonesian langauge.
public static let indonesian = WebPageLanguage(rawValue: "id")
/// The Italian langauge.
public static let italian = WebPageLanguage(rawValue: "it")
/// The Japanese langauge.
public static let japanese = WebPageLanguage(rawValue: "jp")
/// The Korean langauge.
public static let korean = WebPageLanguage(rawValue: "ko")
/// The Malay langauge.
public static let malay = WebPageLanguage(rawValue: "ms")
/// The Brazilian Portuguese langauge.
public static let portugueseBrazilian = WebPageLanguage(rawValue: "pt-BR")
/// The European Portuguese langauge.
public static let portugueseEuropean = WebPageLanguage(rawValue: "pt-PT")
/// The Russian langauge.
public static let russian = WebPageLanguage(rawValue: "ru")
/// The Thai langauge.
public static let thai = WebPageLanguage(rawValue: "th")
/// The Turkish langauge.
public static let turkish = WebPageLanguage(rawValue: "tr")
/// The Vietnamese langauge.
public static let vietnamese = WebPageLanguage(rawValue: "vi")
/// The Simplified Chinese langauge.
public static let chineseSimplified = WebPageLanguage(rawValue: "zh-Hans")
/// The Traditional Chinese langauge.
public static let chineseTraditional = WebPageLanguage(rawValue: "zh-Hant")

the correct word should be "language", but all these comments misspelled it as "langauge"

How to disable the AppUniversalLinkFlow

Hello~ I want to disable the AppUniversalLinkFlow in LINE iOS SDK, only use AppAuthSchemeFlow.

-> How could I achieve that? Since for the case if the device has already installed the LINE app but not logged in yet.
-> The Universal link will open the Safari Webpage automatically. And I am unable to access those private functions in the SDK; please assist me in resolving this issue.

'SecCertificateCopyPublicKey' is unavailable in Mac Catalyst

What did you do?

Enable the mac option for an iOS target in Xcode 11.1, that is, The Catalyst.
Build it.

What did you expect?

Build successfully.

What happened actually?

Got error at CryptoHelpers.swift #172 in LineSDKSwift target saying:
'SecCertificateCopyPublicKey' is unavailable in Mac Catalyst

After some investigation, seems SecCertificateCopyPublicKey is marked as deprecated since iOS 10.2, and SecCertificateCopyKey is recommended in the Documentation from here https://developer.apple.com/documentation/security/1396096-seccertificatecopypublickey

Though there is actually no harm to any existing iOS projects, it would great if we could get this fixed to make the transition for any projects targeting iosmac more easily.

Your environment?

LINE SDK version 5.3.0
Xcode version 11.1
macOS version 10.15

Cannot login my app by line account in iOS 13

What did you do?

Login my app with Line in iPad iOS 13 version, it will lead to a web page.
After entering my user email/password, it shows 500 internal server error.

What did you expect?

I can log in with Line account in iOS 14 with the same version of line app and my own app

Your environment?

iOS 13.2.3 with Line SDK 5.6.2

Screenshot

IMG_0009

Privacy Manifest Scanner Report

Is it a security issue?

N

If you believe you have discovered a vulnerability or have an issue related to security, please DO NOT open a public issue. Instead, send us a mail to [email protected].

What did you do?

Run a code scanner $ mint run techinpark/ios_privacy_manifest_scanner

File Path Used API Line Content
/SourcePackages/checkouts/line-sdk-ios-swift/LineSDK/LineSDK/Networking/API/API+Auth.swift:95 UserDefaults UserDefaultsValue.clear()
/SourcePackages/checkouts/line-sdk-ios-swift/LineSDK/LineSDK/Networking/API/API+Auth.swift:153 UserDefaults UserDefaultsValue.clear()
/SourcePackages/checkouts/line-sdk-ios-swift/LineSDK/LineSDK/Utils/UserDefaultsValue.swift:2 UserDefaults // UserDefaultsValue.swift
/SourcePackages/checkouts/line-sdk-ios-swift/LineSDK/LineSDK/Utils/UserDefaultsValue.swift:22 UserDefaults enum UserDefaultsValue {
/SourcePackages/checkouts/line-sdk-ios-swift/LineSDK/LineSDK/Utils/UserDefaultsValue.swift:24 UserDefaults private static var defaults = UserDefaults.standard
/SourcePackages/checkouts/line-sdk-ios-swift/LineSDK/LineSDK/LineSDKUI/OpenChatUI/Public/OpenChatCreatingController.swift:161 UserDefaults if let cachedName = UserDefaultsValue.cachedOpenChatUserProfileName {
/SourcePackages/checkouts/line-sdk-ios-swift/LineSDK/LineSDK/LineSDKUI/OpenChatUI/Public/OpenChatCreatingController.swift:176 UserDefaults UserDefaultsValue.cachedOpenChatUserProfileName = room.creatorDisplayName
/SourcePackages/checkouts/line-sdk-ios-swift/LineSDK/LineSDK/Login/LoginManager.swift:140 UserDefaults UserDefaultsValue.clear()

Please describe what you did before you encounter the issue.

What did you expect?

Provide a privacy manifest as Apple required

Please describe what you did expect to happen.

What happened actually?

If you upload an app to App Store Connect that uses required reason API without describing the reason in its privacy manifest file, Apple sends you an email reminding you to add the reason to the app’s privacy manifest. Starting May 1, 2024, apps that don’t describe their use of required reason API in their privacy manifest file aren’t accepted by App Store Connect.
ref https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api

Please describe what happened actually.

Your environment?

LINE SDK 5.10.1

Some information of the environment in which the issue happened. LINE SDK version, Xcode version, iOS version, etc.

Sample project

It would be appreciated if you can provide a link to or update a sample project that we can download and reproduce the issue.

After a successful login, the Line app does not redirect to my iOS app directly; instead, it goes to the WebView first

What did you do?

I have created a iOS project and followed the link https://developers.line.biz/en/docs/line-login-sdks/ios-sdk/swift/integrate-line-login/.

What did you expect?

Redirect the user to my iOS app without using a WebView.

What happened actually?

After the user successfully logs in, the Line app redirects the user to a web view before navigating to my iOS app.
preview

Sample project

I used the sample project from this repository and only changed the channelID

About the iOS version of LineSDKObjC.framework

Please let me ask a question about the supported iOS version.

After carthage update we checked framework information with the following command, LineSDKObjC.framework did not include armv7. Will it be said that this is not compatible with iOS 10?

Is my procedure wrong?

$ xcrun lipo -info Carthage/Build/iOS/LineSDK.framework/LineSDK 
Architectures in the fat file: Carthage/Build/iOS/LineSDK.framework/LineSDK are: i386 x86_64 armv7 arm64 

$ xcrun lipo -info Carthage/Build/iOS/LineSDKObjC.framework/LineSDKObjC 
Architectures in the fat file: Carthage/Build/iOS/LineSDKObjC.framework/LineSDKObjC are: x86_64 arm64 

Login is not possible on lower OS (iOS 11, 12).

Is it a security issue?

No

What did you do?

Login using Line SDK does not work on iOS 11, 12.

What did you expect?

normal login

What happened actually?

Login does not work in iOS 11 and 12 environments. After entering the ID and password, a blank screen appears. It looks normal from iOS 13 onwards, and internal tests show that a similar issue occurs on Android 5.

Your environment?

xcode 14.x, iOS 11 and 12 iPhone models. LineSDK 5.8.2, and Line SDK 5.9.1 for later testing also succeeded in reproducing the issue. (However, the xcode version seems meaningless. The previous App released last year also came back and checked again, and it is impossible to log in the same.)

Sample project

We used the sample project provided here and leave a reproduction video.

vllo.mp4

can't login connect with UIScene openURLContexts [BETA]

What did you do? / What did you expect?

To confirm login, LineSDK is using:
application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool

Can't resumeOpenURL(..) since open url is not called anymore, instead the SDK should be compatible with:
scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>)

What happened actually?

Login can't be confirmed.

Your environment?

LINE SDK: 5.2.4
XCode: 11.0 beta 5 (11M382q)
iOS: 13.0 (17A5572a)

Trying To Work Around

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
print(URLContexts.debugDescription)
        if let url = URLContexts.first?.url {
            _ = LoginManager.shared.application(UIApplication.shared, open: url)
        }
    }

Console

Set([<UIOpenURLContext: 0x280866680; URL: line3rdp.com.XXXXXXX.XXX://authorize/?code=XXXXXXXXXXXXXXXXXXXX&state=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX; options: <UISceneOpenURLOptions: 0x2806dc990; sourceApp: (null); annotation: (null); openInPlace: NO>>]) authorizeFailed(reason: LineSDK.LineSDKError.AuthorizeErrorReason.invalidSourceApplication)

Best Regards,
Coriolan Bataille

Distinguish public APIs and auth related APIs

LINE SDK contains a token auto-refreshing feature when public APIs called and fails with an unauthorized error. However, for the OAuth related APIs, especially the verify token API, we are following the OAuth 2.0 spec so we have a different error code when the token is invalid.

However, in our documentation, we mentioned that all methods in API will handle auto-refreshing, which is not the truth. Of course, we can point it out in our documentation, but it would be better if we can have the help of compiler to distinguish these two kinds of APIs.

The plan is deprecating the OAuth related APIs in API, and move them to a nested type, like API.Token, so users can have a better idea the these two are not created equally.

How to use the One-Time Sharing Function

I want to test the function of share content with Line friend, and try the One-Time Sharing.

Also I used the LineSDKSample project to test the share function and select the Login Permissions like this

IMG_7012

but I can not login with One-Time Sharing Permission

IMG_7011

with my channel had not the One-Time Sharing Permission, how can I add the One-Time Sharing Permission to my channel, there is not any edit option for the channel permission.

snap

Thanks for your help!

Is there a reason why the LINE SDKs do not return an authorization code to be used by a backend service?

Referring to the documentation, native clients will send an access token and id token to our backend service. This means that we can't then obtain a refresh token, so when the access token expires we have no access to LINE APIs on behalf of the user. The only way to solve this is for the client to reauthenticate and send new tokens.

Web-based login on the other hand provides the server with an authorization code (docs) which can be exchanged for an access token and a refresh token.

This is a problem for us because we have implemented a login service, for both our web application and native applications, which exchanges external tokens for our own tokens. This works fine for other services (sign in with Apple, sign in with Google, etc.) which do provide an authorization code and therefore allow us to obtain a refresh token for those services. Internally we use the provider refresh token when the access token expires. As LINE does not provide a refresh token, we would have to also have the client send a new LINE access token if the old one has expired, and therefore update our database. I'm sure you can see how this will require us to branch our logic (i.e. if (line) { specialRefreshToken } else { normalRefreshToken }).

Considering the authorization code is used internally within the SDK, I don't quite understand why this is being closely guaraded client-side rather than making this available to pass to backend services instead of being exchanged behind the scenes. Can anybody comment on the reasons behind this (and why LINE is so different to other SSO providers like Google or Apple)?

Sometimes crashing when calling line-sdk-login in Unreal Engine

Is it a security issue?

If you believe you have discovered a vulnerability or have an issue related to security, please DO NOT open a public issue. Instead, send us a mail to [email protected].

What did you do?

I made a CPP-plugin with line-sdk-ios-swift and called line login in Unreal Engine build.

What did you expect?

line login success

What happened actually?

Sometimes crashing when calling line-sdk-login in Unreal Engine build.

Your environment?

Xcode 13.1, Unreal Engine 4.25.4, Line SDK 5.7.0, iOS 12~14 test device

Sample project

Result debugging

class AppUniversalLinkFlow {
    
    let url: URL
    let onNext = Delegate<Bool, Void>()
    
    init(parameter: LoginProcess.FlowParameters) {
        let universalURLBase = URL(string: Constant.lineWebAuthUniversalURL)!
        url = universalURLBase.appendedLoginQuery(parameter)
    }
    
    func start() {
        // crash point!!
        UIApplication.shared.open(url, options: [.universalLinksOnly: true]) {
            opened in
            self.onNext.call(opened)
        }
    }
}

Objective-C Line Login error

I am a new programmer and I need to access the LineSDK and use the line login feature in my company's SDK project.
I had two problems,

The first problem is that when LineAPP is installed, after I click the login button, I can successfully jump to the LineAPP for authentication, but an error is reported after jumping back to the project: LineSDKObjC.LineSDKError.authorizeFailed(reason: LineSDKObjC.LineSDKError.AuthorizeErrorReason.userCancelled),
"error_message" : "User cancelled or interrupted the login process.",
"error_code" : "3003"

The second problem is that when I log in without the Line APP installed, I can confirm the permission on the line login page after jumping to the line login page, but the confirmation key of the return item is invalid. This is the Xcode log: -canOpenURL: failed for URL: "lineauth2://authorize/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)”

These two problems still existed after I created a new Xcode APP project and connected it according to the Line documentation. I don't have enough experience to know if it's a code error or something.
The following is the code of my new Xcode project. If you need the code of this part of the company project, please let me know:

LineSDK 5.9.1, Xcode14.3, IOS16.5

截屏2023-06-12 17 27 25
截屏2023-06-12 17 27 32
截屏2023-06-12 17 28 00
@implementation ViewController

  • (void)viewDidLoad {
    [super viewDidLoad];
    }

  • (IBAction)loginButtonTapped:(id)sender {
    [self login];
    }

  • (void)login {
    [[LineSDKLoginManager sharedManager] loginWithPermissions:@[LineSDKLoginPermission.profile] inViewController:self completionHandler:^(LineSDKLoginResult * _Nullable result, NSError * _Nullable error) {
    if (result) {
    NSLog(@"%@", result.accessToken.value);

          NSString *token = result.accessToken.value;
          LineSDKUserProfile *profile = result.userProfile;
          NSMutableString *message = [NSMutableString stringWithFormat:@"Login succeeded.\n\nAccess Token: %@\n", token];
    
          if (profile) {
              [message appendFormat:@"User ID: %@\n", profile.userID];
              [message appendFormat:@"Display Name: %@\n", profile.displayName];
              [message appendFormat:@"Icon: %@\n", profile.pictureURL];
          }
    
          UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Success" message:message preferredStyle:UIAlertControllerStyleAlert];
          UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
          [alert addAction:okAction];
          [self presentViewController:alert animated:YES completion:nil];
    
      } else {
          NSLog(@"%@", error);
    
          UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Error" message:error.localizedDescription preferredStyle:UIAlertControllerStyleAlert];
          UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
          [alert addAction:okAction];
          [self presentViewController:alert animated:YES completion:nil];
      }
    

    }];
    }
    @EnD
    t1.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.