简体   繁体   中英

How to add or read Google calendar events iOS [Swift] without using Cocoa Pods

I am currently working on integrating Google Calendar into my iOS project which uses GoogleAPIClientForREST And GoogleSignIn libraries. Project Git can be found here . I am able to add or read all my Google calendar events.

However, I have been asked to make it work without using Cocoa Pods. I have added all the necessary frameworks by dragging and dropping into my project, it builds and runs but I'm getting a crash at this line (attached screen shot for ref) GIDSignIn.sharedInstance().scopes = [kGTLRAuthScopeCalendar] .

Here's working screenshot where am getting the kGTLRAuthScopeCalendar element in array. (Using Cocoa Pods)

在此输入图像描述

Here's screenshot where am getting a crash because the kGTLRAuthScopeCalendar element in array has 0 values . (Without Using Cocoa Pods)

在此输入图像描述

Does anyone have any idea what I might have missed, or am I wrong in my implementation without CocoaPods if yes, how?. Please help.

SO links previously referred: 1. How to Create events using Google Calendar API iOS Swift , 2. https://code.tutsplus.com/tutorials/ios-sdk-working-with-google-calendars--mobile-19155

Does anyone have any idea what I might have missed, or am I wrong in my implementation without CocoaPods if yes, how?

Cocoapods is just a dependency manager and distribution mechanism — it doesn't add any actual functionality to your code on its own. You could simply remove the Podfile from your project and you'd be left with a working project that no longer "uses Cocoapods."

One of the lovely things about a dependency manager like Cocoapods is that it manages not only the things that your project needs directly, but also the things that those dependencies need, and so on. There are only two pods listed in your Podfile , but your Podfile.lock shows about 18 pods because the two that you use directly each depend on other pods.

I don't think there's nearly enough information in your post to let us really understand what specific thing(s) you've missed in removing Cocoapods, but from your screenshot it looks like you only have about six frameworks installed in your project while, again, your Podfile.lock shows many more pods than that. It may be that some of the frameworks you need are embedded inside top level ones in your project, but the fact that your project doesn't work correctly even though you're presumably using exactly the same source code is a strong indication that you've left out one or more of the frameworks you need.

Go through the list of pods in Podfile.lock and make sure that the framework each one specifies is included in your new project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM