• This repository has been archived on 19/Dec/2022
  • Stars
    star
    107
  • Rank 323,587 (Top 7 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Objective-C implementation of the unofficial Snapchat API.

SnapchatKit

Version License Platform Issues Stars

Quick FAQ

How do I get login and stuff working?

SnapchatKit relies on Liam Cottle's private API to sign in and make any request, due to how the iOS API works and the limits of our knowledge of its implementation. His API is now public again. Head over to the Casper developer page to get started. Disclaimer: it is not cheap. If you don't know what you're doing or if you're not super serious about using this kit, you should just leave now.

What is Login.h / why is it missing?

It's just a file I keep my credentials in on my computer. You can safely remove any references to it, and any mysterious constants like kUsername or kAuthToken which are defined in Login.h.

Usage

Documentation for SnapchatKit is on Cocoadocs. To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

Add SnapchatKit to your podfile:

pod 'SnapchatKit'

Or add the source files in /Pods to your project, as well as SSZipArchive. SnapchatKit does depend on SSZipArchive, but its Cocoapod version is a version behind it's actual version, which SnapchatKit uses. I have included the required source files in the meantime.

Examples

SnapchatKit revolves around the SKClient class as a singleton. An instance of SKClient manages a Snapchat account. Here, we sign in and get a list of unread snaps and chats:

[SKClient sharedClient].casperAPIKey = @"your_api_key";
[SKClient sharedClient].casperAPISecret = @"your_api_secret";
[SKClient sharedClient].casperUserAgent = @"not_required_but_please_use_one";
[[SKClient sharedClient] signInWithUsername:@"donald-trump" password:@"for_president"
                                 completion:^(NSDictionary *json, NSError *error) {
    NSArray *unread = [SKClient sharedClient].currentSession.unread;
    NSLog(@"%@", unread);
}];

Gmail information is necessary to trick Snapchat into thinking we're using the first-party Android client. SnapchatKit now poses as the iOS client instead of the Android one; Google credentials not required.

To-do

  • TLS chat support
  • Tests

Third party resources

Special thanks to

  • Everyone who built and maintains the PHP implementation.
  • Liam Cottle, for sharing some code used in his app, Casper.
  • Steve, who also worked on the PHP implementation.
  • Harry "The Man" Gulliford.
  • Sam Symons, author of RedditKit.
  • Those unmentioned, you know who you are. Thank you.

License

SnapchatKit is available under the MIT license. See the LICENSE file for more info.

Legal

I'm fairly certain it's 100% legal to use a "private" REST API, and that there are no laws explicitly prohibiting the use of "private" REST APIs. However, this does not mean that the makers of these private APIs can't try to sue you under something overly-broad, such as the CFAA. I don't think Snapchat will, personally; in my experience they've only gone after developers for copyright disputes.

Disclaimer: The name "Snapchat" is a copyright of Snapchatâ„¢, Inc. This project is in no way affiliated with, sponsored, or endorsed by Snapchatâ„¢, Inc. I, the project owner and creator, am not responsible for any legalities that may arise in the use of this project. Use at your own risk.

More Repositories

1

Runtime

An Objective-C simulator written in Swift.
Swift
136
star
2

FLEXing

A simple tweak to activate a FLEX explorer window
Logos
134
star
3

ASM-Swift

A playground for learning Assembly language through Swift.
Swift
103
star
4

Swizzle

A tweak to create basic tweaks from any app.
Objective-C
38
star
5

TBAlertController

UIAlertController, UIAlertView, and UIActionSheet unified for developers wanting to support iOS 7 and 8.
Objective-C
37
star
6

MirrorKit

A framework for reflection in Objective-C: an OO wrapper for the Objective-C runtime
Objective-C
28
star
7

Jsum

Swift
15
star
8

iFinder-Theos

A simple Swift file browser built with Theos as a learning experience
Swift
12
star
9

dump-cleaner

A command-line tool to tidy-up Objective-C interfaces generated with class dump tools.
Objective-C
10
star
10

DiscourseKit

A Swift wrapper for the Discourse API.
Swift
8
star
11

YakKit

An Objective-C implementation of Yik Yak's private API
Objective-C
8
star
12

SwiftForumsStyle

A user style for forums.swift.org, inspired by GitHub
CSS
7
star
13

TBInteractivePushTransition

The interactive push transition iOS was missing.
Objective-C
6
star
14

Zombe-Modpack

An updated version of Zombe Modpack
Java
5
star
15

Objc-iOS-Extensions

A few helpful extensions to some Cocoa Touch classes.
Objective-C
4
star
16

hexrays-docset

Swift
4
star
17

Objective-Clean

TypeScript
4
star
18

TBSockets

A bare-bones CFSocket/NSStream wrapper.
Objective-C
3
star
19

Tic-Tac

A feature-rich Yik Yak client for iOS.
Swift
3
star
20

iOS-9.0.2-Headers

Unmodified headers made with classdump-dyld on ARM64 iOS 9.0.2.
Objective-C
3
star
21

Bash

A bash workspace
Shell
2
star
22

fink

A CLI for downloading videos from Funimation
TypeScript
2
star
23

En-Route

An app for searching for specific points of interest along a given route.
Objective-C
2
star
24

PseudoLint

A linter for Objective-C pseudocode generated by IDA.
Swift
2
star
25

NoScrollbarGrabDelay

A tweak that removes the delay when grabbing the scroll bar on iOS 13
Logos
2
star
26

Objc-Foundation-Extensions

A few helpful extensions to some Foundation classes.
Objective-C
2
star
27

TANHidingButtonBarsViewController

TANHidingButtonBarsViewController is a UITableViewController subclass that mimics how Mobile Safari shows and hides it's navigation bar (and toolbar).
Objective-C
2
star
28

TBSwapQuickActionsX

A tweak to swap the camera and flashlight buttons on the iPhone X lockscreen.
Logos
1
star
29

XCAssetsHelper

A CLI tool to generate an Assets.xcassets folder given a folder of images whose names end in @2x or @3x
Swift
1
star