FLUTTER ECOSYSTEM

TimmyRB/snapkit

SnapKit은 Flutter 프로젝트에 Snapchat 자체 SDK를 통합할 수 있도록 해주는 Flutter 플러그인입니다!

snapkit 프로젝트 이미지
Stars
31
Forks
17
최근 푸시(UTC)
2024. 2. 13.
프로젝트 상태
활성
Jacob Brasil GitHub avatar
GITHUB User

Jacob Brasil ↗

Software Developer

언어DartJavaSwiftRubyObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 4 개
  • flutter{"sdk":"flutter"}
  • http^0.13.3
  • path_provider^2.0.2
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

Snapkit

Pub Package Code Analysis Android Builds iOS Builds

A plugin that allows developers like you to integrate with Snapchat (using SnapKit) into your Flutter applications!

Getting Started

Follow the Wiki for steps on how to get setup in an existing project or just copy the example project into a directory of your choosing and rename it.

Usage

Create new Instance
Snapkit snapkit = new Snapkit();
AuthState Stream
snapkit.onAuthStateChanged.listen((SnapchatUser? user) {
    // Do something with the returned SnapchatUser or null here
});
AuthState Class
class MyAppState extends State<MyApp> implements SnapchatAuthStateListener {

  snapkit.addAuthStateListener(this);

  @override
  void onLogin(SnapchatUser user) {
    // Do something with the returned SnapchatUser here
  }

  @override
  void onLogout() {
    // Do something on logout
  }

}
Login
await snapkit.login();

// or

snapkit.login().then(user => {});
Logout
await snapkit.logout();

// or

snapkit.logout().then(() => {});
Verify a Phone Number

Returns a bool if Snapchat has verified the phone number, throws an error if there was a problem. Always returns false on Android

snapkit.verifyPhoneNumber('US', '1231234567')
  .then(isVerified {})
  .catchError((error, StackTrace stacktrace) {})

Share to Snapchat

Share to LIVE
snapkit.share(SnapchatMediaType.NONE,
  sticker: SnapchatSticker?,
  caption: String?,
  attachmentUrl: String?
);
Share with Background Photo
snapkit.share(SnapchatMediaType.PHOTO,
  image: ImageProvider,
  sticker: SnapchatSticker?,
  caption: String?,
  attachmentUrl: String?
);
Share with Background Video

Currently unavailable on Android

snapkit.share(SnapchatMediaType.VIDEO,
  videoUrl: String,
  sticker: SnapchatSticker?,
  caption: String?,
  attachmentUrl: String?
);
SnapchatSticker
new SnapchatSticker(
  image: ImageProvider
);