info.plist is not saving changes made - react-native

I have been trying to edit my info.plist to use geolocation, every time I do I save the file but when re-running the build it reverts back to its default form without the changes. Can anyone please help, below is the file in question.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LastAccessedDate</key>
<date>2019-07-03T05:00:01Z</date>
<key>WorkspacePath</key>
<string>/Users/JingoLine/repAsc/ios/repAsc.xcworkspace</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is required for xyz benefits for you</string>
</dict>
</plist>
on Re-run it goes back to :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LastAccessedDate</key>
<date>2019-07-03T05:00:01Z</date>
<key>WorkspacePath</key>
<string>/Users/JingoLine/repAsc/ios/repAsc.xcworkspace</string>
</dict>
</plist>

Related

How to launch verdaccio (forked version of sinopia) at boot on mac OS X?

I tried to create .plist at /Library/LaunchDaemons but it doesn't run.
It follows below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.verdaccio</string>
<key>Program</key>
<string>/usr/local/bin/verdaccio</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Thanks in advance.
The right answer to have it working is as below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.verdaccio</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/verdaccio</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>igor</string>
<key>SessionCreate</key>
<true/>
</dict>
</plist>

Can a single-file command line tool written in objective-c handle a URL Scheme?

Using Xcode, is it possible to create an Objective-C or C single-file tool (i.e, no app bundle) that handles a custom URL schema?
I've added -sectcreate __TEXT __info_plist Info.plist_path into my other linker flags and below is my info.plist that is supposed to be added to the binary (not sure how I can confirm that is is being added). But, building the binary doesn't result in myCoolURLHandler://key=value being handled by the new tool.
I've very new to objective-c and Xcode, so I am sure I am missing something.
My info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>Apple.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>URLHandlerTestApp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myCoolURLHandler</string>
</array>
</dict>
</array>
</dict>
</plist>

How to find the number of values in a plist?

I have a plist that looks like the following.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
Translations
-->
<plist version="1.0">
<array>
<dict>
<key>English</key> <string>Hello Mrs./Mr./Miss.</string>
<key>French</key> <string>Bonjour Madame / Monsieur / Mademoiselle.</string>
<key>Spoken</key> <string>Boh(n)-zhoor mah-dahme/ muh-syuhr/ mah-dah-mwa-sell.</string>
</dict>
<dict>
<key>English</key> <string>Excuse me.</string>
<key>French</key> <string>Pardon.</string>
<key>Spoken</key> <string>Par-doh(n).</string>
</dict>
<dict>
<key>English</key> <string>Do you speak English?</string>
<key>French</key> <string>Parlez-vous anglais?</string>
<key>Spoken</key> <string>Par - lay vooz ah(n)-glay?</string>
</dict>
</array>
</plist>
I want to know how to find how many elements are in the plist. For example, there is 3 in the code above. Is there an attribute of plist I can call to find this number?
Read the plist into an array:
NSArray *plistArray = [NSArray arrayWithContentsOfFile:pathToPlistFile];
and count the number of elements:
NSUInteger count = [plistArray count];

Making an array from a plist issue

First, a little background. I am trying to make a platform game. In front of the game layer I want "lights" to go by and by lights I mean white triangles. I am trying to get coordinates for the triangles from a plist.
At this point I have spent days trying to get my app to read from a plist and I cannot get it to work.
This is what I currently have and this is basically what the internet is saying I should have and that it should work.
In helloWorld.h:
NSMutableArray *foregroundLights;
In helloWorld.m
NSString *path = [[NSBundle mainBundle] pathForResource:#"foregroundlights" ofType:#"plist"];
foregroundLights = [[NSMutableArray alloc] initWithContentsOfFile:path];
I have tried formatting the patch every way that I can think of, I have tried using NSSearchPathsForDirectoriesInDomains. I have tried making the plist a dictionary and making it an array. What am I missing?
Here is a piece of the plist. The full one contains 50 arrays of 4 ints.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>root</key>
<array>
<array>
<integer>128</integer>
<integer>68</integer>
<integer>246</integer>
<integer>7</integer>
</array>
<array>
<integer>181</integer>
<integer>84</integer>
<integer>170</integer>
<integer>62</integer>
</array>
<array>
<integer>118</integer>
<integer>51</integer>
<integer>142</integer>
<integer>64</integer>
</array>
</array>
</dict>
</plist>

Route Me: Caching Tiles limit?

I am using the route me frame work for my map application.
I badly want to cache more tiles than its caching by default.
So i changed the routeme.plist like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>capacity</key>
<integer>16</integer>
<key>type</key>
<string>db-cache</string>
</dict>
<dict>
<key>capacity</key>
<integer>100000</integer>
<key>minimalPurge</key>
<integer>5000</integer>
<key>strategy</key>
<string>LRU</string>
<key>type</key>
<string>memory-cache</string>
<key>useCachesDirectory</key>
<true/>
</dict>
</array>
</plist>
But it doesn't matter which values i change, the app always reloads tiles which i have already seen before. Is there a limit for caching?