Apress / Mastering-ARKit

source code
Other
9 stars 5 forks source link

[ UPDATE: Found the bug on your plist/resolved ] Chapter 15 app, Multipeer, the multipeer permission widget is not popping up. 2 bugs. #9

Closed popbijoux closed 2 years ago

popbijoux commented 2 years ago

PS: Issue resolved at 5:41pm EST. Full updated p.list code added to the bottom of this file.

hi there thank you for your reply re: my multipeer question abt an app I am working on. I am loving your book so far. There is so much that I don't know. I love the tone and style of the book. It's clear, concise and conversational.

I just finished your chapter on multipeer and I tested on two phones and found some bugs. ( I noticed bcs the multipeer pop up notification never came up). So I am trying to figure out why.

1. The Multipeer capability is not showing up.

I first looked at the p.list - a common mistake that happens to me all the time and indeed, a few lines were missing from the p.list

Under the Local Network permission part ( under found under Privacy on the dropdown menu )

    <key>NSLocalNetworkUsageDescription</key>
    <string>This application will use local networking to discover nearby devices.</string>

The Bonjour services part:

  <key>NSBonjourServices</key>
        <array>
            <string>_ar-collab._tcp</string>
            <string>_ar-collab._udp</string>
        </array>

Now i did that and still the widget that asks for permission is not popping up.

Currently, this is the error message I get on the console:

2022-06-07 17:19:27.157737-0400 Sharing[581:20979] [MCNearbyServiceAdvertiser] Server did not publish: errorDict [{
    NSNetServicesErrorCode = "-72008";
    NSNetServicesErrorDomain = 10;
}].

I haven't resolved it yet but as soon as I do, I will let you know.

I have been testing tons of apps myself so I know this is a common issue. I will let you know if I am able to resolve it.

5:38pm EST: Issue resolved, see full/correct p.list code below to add to the chapter 15 folder

`hi so it's working now. I hadn't closed the array when I added the Bonjour services code on the plist. I can see the tiny 2 ppl button now and the widget popped up. FYI here is the updated code. I am not sure how to update the file directly.

<?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>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSCameraUsageDescription</key>
    <string>For Augmented Reality.</string>
    <key>LSApplicationCategoryType</key>
    <string></string>
    <key>UIApplicationSceneManifest</key>
    <dict>
        <key>UIApplicationSupportsMultipleScenes</key>
        <false/>
        <key>UISceneConfigurations</key>
        <dict>
            <key>UIWindowSceneSessionRoleApplication</key>
            <array>
                <dict>
                    <key>UISceneConfigurationName</key>
                    <string>Default Configuration</string>
                    <key>UISceneDelegateClassName</key>
                    <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
                    <key>UISceneStoryboardFile</key>
                    <string>Main</string>
                </dict>
            </array>
        </dict>
    </dict>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
        <key>NSBonjourServices</key>
        <array>
            <string>_ar-collab._tcp</string>
            <string>_ar-collab._udp</string>
    </array>
</dict>
</plist>

`

jayvenn commented 2 years ago

@popbijoux When you said you love the book's style, especially for its clarity, conciseness, and conversational tone, it means a lot!

Appreciate your help in improving the books' sample projects. Changes made to Chapter 15's sample projects' Info.plist:

Thanks for the support! Once you finish the book - would appreciate it if you can post a review on Amazon or wherever appropriate to help the book get into the hands of other builders out there. Super stoked that you are enjoying the book and can't wait to see all the great things you're bringing into the world.