Latest 0.1.3
Homepage https://github.com/greedlab/greedpatch-ios
License MIT
Platforms ios 7.0, requires ARC
Dependencies AFNetworking, ZipArchive, FileMD5Hash, JSPatch, JSPatch/Extensions, JSPatch/JPCFunction, JSPatch/JPBlock, JSPatch/JPCFunctionBinder
Frameworks Foundation
Authors

Version
License
Platform

iOS SDK for greedpatch

English | 中文

Installation

greedpatch-ios is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "greedpatch-ios"

Usage

Write patch files

Write js files with JSPatch in your project.

Config greedpatch

config greedpatch like

[[GRPPatchManager sharedInstance] setProjectId:@"57d61489f0068561dce9baee"];
[[GRPPatchManager sharedInstance] setToken:@"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0NzM2NDg2MzA0ODgsImlkIjoiNTdkM2JmMmY5MDE1ZWU0N2ZjYzNjYWJhIiwic2NvcGUiOiJwYXRjaDpjaGVjayJ9.YPedieEibUgLecWDmuIVIdkY_Ra-4Qa2HeIQpE7Z_k8"];
[[GRPPatchManager sharedInstance] setCompressPassword:@"compress_password"];

ProjectId

greedpatch > Create project > Project Detail. And then you can see Project ID

Token

visit Generate new token to generate it.

compressPassword

Used to encrypt you patch file.

Test patch

[[GRPPatchManager sharedInstance] testPatch];

test js files in your project

Compress patch

[[GRPPatchManager sharedInstance] compressPatch];

Compress js files in your project to a zip file, and generate the hash code for the zip file. You can see them in Xcode’s console.

upload patch

greedpatch > select the project > click Create patch > upload zip file from the last step, click Upload > select the project version , input the hash from the last step > Create

Patch

[[GRPPatchManager sharedInstance] patch];

If there are patch available for current project version,the patch will come into effect

Check need patch

[[GRPPatchManager sharedInstance] requestPatch];

request remote server whether there a new patch for current project version.

Demo

Example

Thanks

JSPatch

License

greedpatch-ios is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "greedpatch-ios",
    "version": "0.1.3",
    "summary": "iOS SDK for greedpatch",
    "homepage": "https://github.com/greedlab/greedpatch-ios",
    "license": "MIT",
    "authors": {
        "Bell": "[email protected]"
    },
    "source": {
        "git": "https://github.com/greedlab/greedpatch-ios.git",
        "tag": "0.1.3"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*.{h,m}",
    "frameworks": "Foundation",
    "dependencies": {
        "AFNetworking": [],
        "ZipArchive": [],
        "FileMD5Hash": [],
        "JSPatch": [],
        "JSPatch/Extensions": [],
        "JSPatch/JPCFunction": [],
        "JSPatch/JPBlock": [],
        "JSPatch/JPCFunctionBinder": []
    }
}

Pin It on Pinterest

Share This