The Genesis egg distribution is over!

In this post we will briefly outline some of the most important issues Dragonereum players encountered during the Genesis and what the development team did to solve them. The first and main issue was…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Using .xcconfig files to store various SDK keys and IDs inside Xcode Project.

If you all are familiar with integrating Facebook SignIn SDK or GoogleSignIn SDK and other SDKs with their iOS Applications in Xcode.

It’s OK to save directly in plist.

Incase of Facebook and Google Login integration you have to also add URL Types in project target -> Info.

what if one day come you have to change these development keys, IDs, Secret IDs, ClientIds, RevereClientIds etc for a project. Then you have to change these things in multiple places like info.plist, URL Types in Info of project target and in .swift files in some cases.

So here is the solution if you want to manage these things in only one place.

Create two files with .xconfig extensions inside project named Release.xcconfig and Debug.xcconfig and write all your keys, ReverseClientIds, ClientIds etc of various SDKs in both files like below.

Now you can access these via following syntax inside plist and URL types of Project Target -> Info

Now your Info.plist will appear like these.

same repeat inside URL Types (Project Target -> Info)

If you want to access .xcconfig any key or value inside .swift file. Like incase of Google SignIn you have to access Google Client ID in following code

Then you can’t access value directly from .xconfig file but you can access from Info.plist file. so please first make sure it’ll be added inside Info.plist

so for accessing this from Info.plist write the following code.

One more thing if you have installed Facebook SDK, GoogleSDK or any other SDK then you could find two .xcconfig files in your xcode project already with following naming convention.

So you have import or include these files inside your Release.xcconfig and Debug.xcconfig files respectively.

Write following inside Release.xcconfig on first line.

Inside Debug.xcconfig write this.

Now you have to complete your last step.

Goto project navigator-> Info -> Configurations

and change Red marked xcconfig files with you created files like given below.

Now you have all your Keys, ClientIDs etc all in one place. You can change these anytime in Release.xconfig and Debug.xcconfig files.

Happy Coding: — — — — — — ) Peace Guys 👋 👋👋

Do 👏 👏 👏 if you find it beneficial.

Add a comment

Related posts:

The reason I read books about history

I read books about history. It is the reason why I want to know what the people living in the era worried, how they coped with, and what occurred. Entrepreneurs study history. It is because they want…

A Simple Process For Writing Medium Articles

Some writers are able to crank out post after post on Medium while you may be struggling to publish very much. How do people manage to be productive and efficient when it comes to writing on Medium…

Australia Bush Fires and the End of the World?

Hey!! remember the time when everything was normal and we even made jokes about WW3? Yeah, that is not the case anymore. A whole frickin country is on fire and you are sitting there in your lawn…