Git Product home page Git Product logo

swift-sdk's Introduction

Kinvey Swift SDK

CI

badge-platforms badge-pms badge-mit

The Kinvey Swift SDK is a package that can be used to develop iOS applications on the Kinvey platform. Refer to the Kinvey DevCenter for documentation on using Kinvey.

In the version 3 of the library, all new code is written in Swift and any application using v3 must also use Swift to access the API.

While we transition from Objective C to the latest Swift versions, we will use the following branching scheme. Please, pick the right version of our library depending of which langugage / version you are using:

Language / Version Kinvey SDK Version Development Branch
Swift 3 and Swift 4 3.3.0 and above master
Swift 2.3 3.2.x 3.2
Objective-C 1.x 1.x

Note:

  • The master branch represents the latest release of the SDK. See the CONTRIBUTING guidelines for details on submitting code.
  • On version 1.x, use the KinveyKit workspace. On all other versions, use the Kinvey workspace.

Building

You will need Carthage, Jazzy and Xcode command line tools installed to be able to build the SDK.

  • make: runs build, archive, pack and docs commands one after another which will build and pack the project and also generate the documentation files using Jazzy

Check the Makefile for all available commands

Testing

Use Xcode to run the unit tests.

  • Open the file Kinvey.xcworkspace in Xcode
  • Select the Kinvey scheme
  • Select the menu item Product -> Test or press Command+U

Or run the command line:

make test

Important Note: adding the environment variables KINVEY_APP_KEY, KINVEY_APP_SECRET and KINVEY_MIC_APP_KEY will allow you to run the tests against a real Kinvey environment.

Releasing

We use GitFlow workflow for better management.

The workflow for releasing a new version of the SDK is as follows:

  1. Merge all waiting pull requests / feature branches on the develop branch.
  2. Bump the version running make set-version on the develop branch.
  3. Checkout the master branch and merge the develop branch.
  4. Tag the version with git.
  5. Push all changes.
  6. Upload the zip file containing all the binary files for Amazon AWS.
  7. Run make deploy-cocoapods in order to publish the new release for CocoaPods
  8. Publish release notes, API Reference Docs, and the Download section in the DevCenter repo.
  9. Push all changes to deploy.
  10. Send the email with the release notes for the Customer Service and Development team

Version Management

Updating the sdk version should follow Semantic Version 2.0.0:

  • Major (x.0.0): when making an incompatible API changes.
  • Minor (3.x.0): when adding functionality in a backwards-compatible manner.
  • Patch (3.0.x): when making backwards-compatible bug fixes or enhancements.

License

See LICENSE for details.

Contributing

See CONTRIBUTING.md for details on reporting bugs and making contributions.

swift-sdk's People

Contributors

dimofeev avatar echoabstract avatar heyzooi avatar ifabijanovic avatar m0rganic avatar mbektchiev avatar mkapostolov avatar tejasranade avatar thomasconner avatar ventsislav-georgiev avatar vinaygahlawat avatar

Stargazers

 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

swift-sdk's Issues

Mappable crashing in List<StringValue>

After updating to version 3.18.1 my models are crashing when trying to map List<StringValue> with exception:

Terminating app due to uncaught exception 'RLMException', reason: 'Invalid value 'XXXXX' to initialize object of type 'StringValue': missing key 'value''.

Model looks something like this:

class MyModel: Kinvey.Entity {
  @objc dynamic var someSimpleProperty: String?
  @objc dynamic var someComplexProperty: ComplexType?

  override func propertyMapping(_ map: Map) {
    super.propertyMapping(map)

    self.someSimpleProperty <- ("someSimpleProperty", map["someSimpleProperty"])
    self.someComplexProperty <- ("someComplexProperty", map["someComplexProperty"])
  }
}

class ComplexType: Kinvey.Object, Kinvey.Mappable {
  @objc dynamic var someSimpleProperty: String?
  let someListProperty = Kinvey.List<StringValue>()

  func mapping(map: Map) {
    self.someSimpleProperty <- ("someSimpleProperty", map["someSimpleProperty"])
    self.someListProperty <- ("someListProperty", map["someListProperty"])
  }
}

Tested on iPhone 8 simulator, iOS 11.4. Happens regardless if its a fresh app install or update from app running an older Kinvey SDK (and maybe performing a data migration). Xcode 9.4.1, macOs 10.13.6.

Shift to Codable is a really big change, is the SDK going to major version 4 soon when Mappable support is removed?

Cascade delete causes crash on sync

Hello, after updating to version 3.21.0 and launching my app on the simulator is I get this crash:

2019-01-02 10:16:46.409814+0100 -[Swift._SwiftDeferredNSArray UTF8String]: unrecognized selector sent to instance 0x600003fd0aa0
2019-01-02 10:16:46.427309+0100 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Swift._SwiftDeferredNSArray UTF8String]: unrecognized selector sent to instance 0x600003fd0aa0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001116551bb __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x0000000110bf3735 objc_exception_throw + 48
	2   CoreFoundation                      0x0000000111673f44 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x0000000111659ed6 ___forwarding___ + 1446
	4   CoreFoundation                      0x000000011165bda8 _CF_forwarding_prep_0 + 120
	5   libswiftos.dylib                    0x0000000113c46da9 _os_log_encode + 2441
	6   libswiftos.dylib                    0x0000000113c47245 _swift_os_signpost_with_format + 149
	7   libswiftos.dylib                    0x0000000113c461d0 $S2os0A9_signpost_3dso3log4name0B2ID__ySo0a1_B7_type_ta_SVSo03OS_a1_D0Cs12StaticStringVAA010OSSignpostF0VALs7CVarArg_pdtFySRys5UInt8VGXEfU_ySPys4Int8VGXEfU_yARXEfU_TA + 624
	8   libswiftos.dylib                    0x0000000113c447e1 $Ss12StaticStringV14withUTF8BufferyxxSRys5UInt8VGXElFyt_Tg507$SSRys5F18VGIgy_ACytIegyr_TRAFIgy_Tf1ncn_n + 49
	9   libswiftos.dylib                    0x0000000113c45c8e $S2os0A9_signpost_3dso3log4name0B2ID__ySo0a1_B7_type_ta_SVSo03OS_a1_D0Cs12StaticStringVAA010OSSignpostF0VALs7CVarArg_pdtFySRys5UInt8VGXEfU_TA + 190
	10  libswiftos.dylib                    0x0000000113c447e1 $Ss12StaticStringV14withUTF8BufferyxxSRys5UInt8VGXElFyt_Tg507$SSRys5F18VGIgy_ACytIegyr_TRAFIgy_Tf1ncn_n + 49
	11  libswiftos.dylib                    0x0000000113c453cd $S2os0A9_signpost_3dso3log4name0B2ID__ySo0a1_B7_type_ta_SVSo03OS_a1_D0Cs12StaticStringVAA010OSSignpostF0VALs7CVarArg_pdtF + 317
	12  Kinvey                              0x000000012623c36b $S6Kinvey10RealmCacheC13cascadeDelete5realm10entityType0G012deleteItselfy0B5Swift0B0C_SSAI6ObjectCSbtFTf4nxnnn_n + 1115
	13  Kinvey                              0x0000000126225558 $S6Kinvey10RealmCacheC4save8entities9syncQueryys25AnyRandomAccessCollectionVyxG_AA0G0C5query_10Foundation4DateV8lastSynctSgtFyycfU_y0B5Swift0B0CcfU_yxXEfU_ + 184
	14  Kinvey                              0x000000012623c839 $S6Kinvey10RealmCacheC4save8entities9syncQueryys25AnyRandomAccessCollectionVyxG_AA0G0C5query_10Foundation4DateV8lastSynctSgtFyycfU_y0B5Swift0B0CcfU_yxXEfU_TA + 25
	15  Kinvey                              0x000000012623c874 $Sxs5Error_pIggzo_xsAA_pIegnzo_So8NSObjectCRbz6Kinvey11PersistableRzlTRTA + 20
	16  Kinvey                              0x00000001262e37ef $SST6KinveyE22forEachAutoreleasepoolyyy7ElementQzKXEKFyADKXEfU_yyKXEfU_TA + 31
	17  Kinvey                              0x00000001262d1fdc $Ss5Error_pIgzo_ytsAA_pIegrzo_TR + 12
	18  Kinvey                              0x00000001262e3831 $Ss5Error_pIgzo_ytsAA_pIegrzo_TRTA + 17
	19  libswiftObjectiveC.dylib            0x0000000113b71d7f $S10ObjectiveC15autoreleasepool8invokingxxyKXE_tKlF + 47
	20  Kinvey                              0x00000001262e2f46 $SST6KinveyE22forEachAutoreleasepoolyyy7ElementQzKXEKFyADKXEfU_ + 166
	21  Kinvey                              0x00000001262e3b49 $SST6KinveyE22forEachAutoreleasepoolyyy7ElementQzKXEKFyADKXEfU_TA + 25
	22  libswiftCore.dylib                  0x00000001130de560 $SSTsE7forEachyyy7ElementQzKXEKF + 352
	23  libswiftCore.dylib                  0x000000011312ac2b $SSayxGSTsST7forEachyyy7ElementQzKXEKFTW + 59
	24  libswiftCore.dylib                  0x00000001132eda8e $Ss26_RandomAccessCollectionBoxC8_forEachyyy7ElementQzKXEKF + 126
	25  libswiftCore.dylib                  0x00000001132f16ae $Ss13AnyCollectionV7forEachyyyxKXEKF + 62
	26  libswiftCore.dylib                  0x00000001132f3d3d $Ss25AnyRandomAccessCollectionVyxGSTsST7forEachyyy7ElementQzKXEKFTW + 13
	27  libswiftCore.dylib                  0x00000001133b1227 $SST7forEachyyy7ElementQzKXEKFTj + 7
	28  Kinvey                              0x00000001262dc256 $SST6KinveyE22forEachAutoreleasepoolyyy7ElementQzKXEKF + 118
	29  Kinvey                              0x0000000126225460 $S6Kinvey10RealmCacheC4save8entities9syncQueryys25AnyRandomAccessCollectionVyxG_AA0G0C5query_10Foundation4DateV8lastSynctSgtFyycfU_y0B5Swift0B0CcfU_ + 240
	30  Kinvey                              0x000000012623c7f9 $S6Kinvey10RealmCacheC4save8entities9syncQueryys25AnyRandomAccessCollectionVyxG_AA0G0C5query_10Foundation4DateV8lastSynctSgtFyycfU_y0B5Swift0B0CcfU_TA + 41
	31  Kinvey                              0x000000012623d51f $S6Kinvey10RealmCacheC5write33_86B2BB33C4BBCEC09C15D93A3086D6BALLyyy0B5Swift0B0CKcKFyyKXEfU0_TA + 31
	32  RealmSwift                          0x00000001267d7c15 $S10RealmSwift0A0C5writeyyyyKXEKF + 53
	33  Kinvey                              0x000000012622add3 $S6Kinvey10RealmCacheC5write33_86B2BB33C4BBCEC09C15D93A3086D6BALLyyy0B5Swift0B0CKcKF + 371
	34  Kinvey                              0x000000012622483e $S6Kinvey10RealmCacheC4save8entities9syncQueryys25AnyRandomAccessCollectionVyxG_AA0G0C5query_10Foundation4DateV8lastSynctSgtFyycfU_ + 366
	35  Kinvey                              0x000000012623c909 $S6Kinvey10RealmCacheC4save8entities9syncQueryys25AnyRandomAccessCollectionVyxG_AA0G0C5query_10Foundation4DateV8lastSynctSgtFyycfU_TATm + 25
	36  Kinvey                              0x000000012623c740 $S6Kinvey10RealmCacheC4save8entities9syncQueryys25AnyRandomAccessCollectionVyxG_AA0G0C5query_10Foundation4DateV8lastSynctSgtFyycfU_TA + 16
	37  Kinvey                              0x00000001262d2464 $S6Kinvey8ExecutorC7executeyyyycFyycfU_yyXEfU_TATm + 20
	38  Kinvey                              0x00000001262d2440 $S6Kinvey8ExecutorC14executeAndWaityyyycFyycfU_yyXEfU_TA + 16
	39  Kinvey                              0x00000001262d2549 $S6Kinvey8ExecutorC14executeAndWaityyyycFyycfU_yyXEfU_TA.17 + 9
	40  Kinvey                              0x00000001262d2021 $Ss5Error_pIgzo_ytsAA_pIegrzo_TRTA + 17
	41  Kinvey                              0x00000001262d2539 $Ss5Error_pIgzo_ytsAA_pIegrzo_TRTA.21 + 9
	42  libswiftObjectiveC.dylib            0x0000000113b71d7f $S10ObjectiveC15autoreleasepool8invokingxxyKXE_tKlF + 47
	43  Kinvey                              0x00000001262d23bc $S6Kinvey8ExecutorC14executeAndWaityyyycFyycfU_TA + 140
	44  Kinvey                              0x0000000126215fe0 $SIeg_IeyB_TR + 32
	45  Foundation                          0x0000000110660f9e __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
	46  Foundation                          0x0000000110660ea5 -[NSBlockOperation main] + 68
	47  Foundation                          0x000000011065dc14 -[__NSOperationInternal _start:] + 689
	48  Foundation                          0x0000000110663c4b __NSOQSchedule_f + 227
	49  libdispatch.dylib                   0x0000000119e85046 _dispatch_block_async_invoke2 + 83
	50  libdispatch.dylib                   0x0000000119e77602 _dispatch_client_callout + 8
	51  libdispatch.dylib                   0x0000000119e8499a _dispatch_main_queue_callback_4CF + 1541
	52  CoreFoundation                      0x00000001115ba3e9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	53  CoreFoundation                      0x00000001115b4a76 __CFRunLoopRun + 2342
	54  CoreFoundation                      0x00000001115b3e11 CFRunLoopRunSpecific + 625
	55  GraphicsServices                    0x00000001157a51dd GSEventRunModal + 62
	56  UIKitCore                           0x00000001203ea81d UIApplicationMain + 140
	57  muvr                                0x000000010cdd0fc7 main + 71
	58  libdyld.dylib                       0x0000000119eed575 start + 1
	59  ???                                 0x0000000000000001 0x0 + 1
)

Steps to reproduce

Not sure, it seems to be data related as I can get it to crash 100% of the time on multiple simulators (iPhone 8, iPhone XS, both running iOS 12.1) - apps on both simulators are logged in to the same user account.

Kinvey SDK Version

3.21.0

Tool Versions (XCode / Swift / iOS / Device)

Xcode 10.1, Swift 4.2, iOS 12.1, iPhone 8/XS simulators

Unable to use Swift Package Manager with v4.1.1

Description

I tried to use Swift Package Manager to add dependency for Kinvey iOS SDK v4.1.1 and it showed the error message of containing incompatible dependencies.

Steps to reproduce

In Xcode 11.2.1, File -> Swift Packages -> Add Package Dependency -> Paste https://github.com/Kinvey/swift-sdk.git -> Error shown

Kinvey SDK Version

4.1.1 for Swift Package Manager

Tool Versions (XCode / Swift / iOS / Device)

XCode 11.2.1
Swift 5

Screen Shot 2019-12-04 at 11 02 03 AM

PubNub dependency out of date

Description

PubNub version 4.9.0 is being used for pods, kinvey version 3.23.0. Can't build the project with PubNub because of a dependency issue on the library's variable stripMobilePayload.

A suggested fix is to update the .podspec to the specific appropriate dependency versions.

Steps to reproduce

  1. Create a new project.
  2. Create a Podfile and add Kinvey to Podfile project target
  3. Pod install
  4. Attempt to build the project once workspace created.

Kinvey SDK Version

3.23.0 to most recent release

Tool Versions (XCode / Swift / iOS / Device)

Xcode 10.2 / Swift 5 / iOS 12.2

Crash: 'RLMException', reason: ''MyObject' does not have a primary key defined

Description

After upgrading to XCode 10.2, Swift 5, and Kinvey 3.22.0 I keep getting this error:
Terminating app due to uncaught exception 'RLMException', reason: ''MyObject' does not have a primary key defined

Steps to reproduce

Build with code 10.2 Swift 5

Kinvey SDK Version

3.22.0

Tool Versions (XCode / Swift / iOS / Device)

XCode 10.2, Swift 5

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.