Coder Social home page Coder Social logo

linekit's Introduction

LineKit

Build Status

Share to LINE from your apps.

LineKit now support sharing text, and images friends, and groups. Sharing to timeline is also supported.

Also, an UIActivity subclass is also provided for use with UIActivityController.

Usage

LineKit provides a helper method to check if LINE app is installed on current device.

if (![Line isLineInstalled]) {
  // Prompt error
}

To share text to LINE, you can simply call:

[Line shareText:@"Hello Line!"];

To share image to LINE, you can call:

[Line shareImage:[UIImage named:@"avatar.png"]];

To add friend or official account, use:

[Line addFriend:@"hPtAUZX6w5"];

To show shop detail (usually stickers), try:

[Line showShopDetail:@"2"];

You can redirect user to App Store to download LINE app via:

[Line openLineInAppStore];

Add line:// to LSApplicationQueriesSchemes

For LineKit to properly detect LINE's installation, please add line:// to LSApplicationQueriesSchemes.

After iOS 9.0, you must declare the URL schemes you pass to this method by adding the LSApplicationQueriesSchemes key to your app's Info.plist file.

UIActivity

To use LineKit with UIActivityViewController is simple and recommended:

UIActivityViewController *controller = 
  [[UIActivityViewController alloc] initWithActivityItems:items
                                    applicationActivities:@[[[LKLineActivity alloc] init]]];

iOS 7's limitation for image sharing

Due to iOS 7 limitation, custom UIPasteboard objects couldn't be shared across apps without the same namespace (i.e. jp.naver.*)

So for iOS 7, general UIPasteboard object is used for image sharing. Be careful that users might lose paste data.

Sample Project

The Xcode project under LKExample folder is a sample app to demonstrate the usages of LineKit.

Installation

We recommend you to install via CocoaPods.

Thanks

Thanks @bcylin for some part of codes for LKLineActivity.

Thanks @trisix for LKLineActivity images.

Users

Feel free to open a pull request or send a issue to let me know!

License

LineKit is available under the MIT license.

Copyright (C) 2014 Richard Lee

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

linekit's People

Contributors

bcylin avatar dlackty avatar knchst 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

linekit's Issues

Does not work after LINE v5.2.0

Using LineKit 1.4.1 to share image, the function works well until LINE has been updated to v5.2.0.

The sharing line is simple:

[Line shareImage:selectedImage]; 

where selectedImage is a UIImage. LINE prompts:

This version of LINE does not support this type of URL.

Please help.

Cannot add friend by Line ID

Hi,

I try to add friend by using Line ID when call method it will open Line app and always show message _"User not found."_

example of code, friend id is "nyan"

[Line addFriend:@"nyan"];

From your example you use _hPtAUZX6w5_ as Line ID, my question is how to get or generate this hash string ?

Thank you for your answer,
nonth

UIActivity support?

It will be awesome if LineKit got a UIActivity subclass, thus user can simply choose "Share to LINE" from a UIActivityViewController.

Share text & image simultaneously

This is not really an 'issue' as such but wondering if there's a way to share an image and text at the same time. I can't seem to find a solution so far.

Cheers
Tim

How to make it work

update your info.plist:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>line</string>
</array>

Unable to connect

What I got when click share: Update to the latest version of LINE or recheck the URL.

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.