2

My UDP broadcast code for IOS mysteriously stopped working. Code from the same source still works on old iphones, which makes me suspect some snafu in the build process. According to some docs, apple requires com.apple.developer.networking.multicast entitlement as of IOS 14.

How can I ensure this is included in the build?

ddyer
  • 1,792
  • 19
  • 26

2 Answers2

2

Based on this answer. You need to first get approval from Apple to use multicast. We'll add the build hint:

ios.entitlements.multicast=true

Which will implement part 3 in that answer.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • So adding this to my build does nothing, yet? – ddyer Jun 19 '21 at 07:29
  • I got the permission from apple. If I read the tea leaves correctly the ios entitlements build hint should end up in the info.plist file, but I do not see it there in today's build. – ddyer Jun 26 '21 at 01:10
  • If you add the build hint it will work, you need to add it and send a new build. – Shai Almog Jun 26 '21 at 05:19
  • Not working yet. Where exactly in the sources should I see the result of the build hint? – ddyer Jun 27 '21 at 22:22
  • Codesign pushes the entitlements into the binary as part of its signing process. If you added the hint manually make sure you included the `codename1.arg.` prefix. – Shai Almog Jun 28 '21 at 01:35
  • That's what is in my build hints file. This has no effect on the executable you build. I'm looking for where it would be manifest in the build sources. codename1.arg.ios.enableproguard=false codename1.arg.ios.entitlements.multicast=true codename1.arg.ios.fastbuild=true – ddyer Jun 28 '21 at 17:22
  • Grep the code for `com.apple.developer.networking.multicast` which should be in a plist there. – Shai Almog Jun 29 '21 at 01:39
  • The entitlement phrase doesn't occur anywhere in the sources you generated – ddyer Jun 29 '21 at 17:46
  • I think it's only in the signature itself. That means it's only in the binary and not in the source – Shai Almog Jun 30 '21 at 01:26
  • It's not clear to me how this is supposed to work, but if I were building my own binaries as most apple developers do, there would have to be something in the xcode project that reflected the desire to use multicast, wouldn't there? Then separately when apple signs the binary for purposes of the app store, it checks that you have their permission to make that request. – ddyer Jun 30 '21 at 03:44
  • We generate the entitlement file outside of the project since it's a part of the signing phase then use it to sign from command line. I'm not sure if it makes sense that it's outside of the project at lease for cases of build from source. Either way I'm not sure if xcode will pick it up even if we include it in the directory – Shai Almog Jul 01 '21 at 01:43
  • -- so how do we debug this process? I got permission from apple, added the build hint, made new manifests, built new binaries, but my app still can't multicast. – ddyer Jul 01 '21 at 16:26
  • I'm looking into this. – Shai Almog Jul 02 '21 at 03:18
  • I found a problem in my code, this should be fixed for the next update on Friday. Sorry about the delay – Shai Almog Jul 20 '21 at 03:02
  • no change today. still doesn't work, still no sign of the entitlement in the sources. – ddyer Jul 23 '21 at 20:25
  • Odd. I redeployed the servers, sometimes things are a bit flaky in the deployment so hopefully it's that. – Shai Almog Jul 24 '21 at 04:51
  • Redeployed again earlier but we got feedback the problem still isn't fixed. Looking into it. – Shai Almog Jul 25 '21 at 02:07
  • I still don't see any evidence of a multicast entitlement in the latest build sources. Can you tell me what I should be able to see? – ddyer Jul 30 '21 at 17:01
  • This isn't in the source include, only in the binary. If you unzip that the entitlement file should be in there somewhere. – Shai Almog Jul 31 '21 at 04:40
  • I put ios.entitlements.multicast in the projectg build hints, and it is supposed to end up in the binary in the entitlements file. There has to be some bridge in the sources that tells the build process to put it there. Show me in one of your projects. – ddyer Jul 31 '21 at 17:53
  • No. The file is used during the build process and it's only a part of the CLI. We're thinking of a way to include it into the downloaded sources but it still won't be a part of the physical project. – Shai Almog Aug 01 '21 at 01:31
  • I see - but whatever the process is supposed to be, it's not working yet. Latest build still gets no UDP on modern devices, but still works on old ones. – ddyer Aug 01 '21 at 23:24
  • We're trying to reproduce this, unfortunately it's not something trivial to reproduce – Shai Almog Aug 02 '21 at 03:20
  • We finally fixed this, it should work with new builds now... – Shai Almog Aug 05 '21 at 13:03
  • Finally works. What an ordeal for all concerned. Thanks apple! – ddyer Aug 08 '21 at 21:47
0

The entitlement phrase doesn't occur anywhere in the sources you generate

guava:~ davedyer$ cd Desktop/
guava:Desktop davedyer$ cd boardspace-5.49
guava:boardspace-5.49 davedyer$ ls
dist    res
guava:boardspace-5.49 davedyer$ grep -r -i multicast *
dist/Launch-src/cn1_class_method_index.m:    "multicast" /* 384 */,
dist/Launch-src/java_net_URIHelper.h:extern JAVA_OBJECT get_static_java_net_URIHelper_MULTICAST();
dist/Launch-src/java_net_URIHelper.m:JAVA_OBJECT get_static_java_net_URIHelper_MULTICAST(CODENAME_ONE_THREAD_STATE) {
dist/Launch-src/java_net_URIHelper.m:    return STRING_FROM_CONSTANT_POOL_OFFSET(384) /* multicast */;
dist/Launch-src/java_net_URIHelper.m:    /* LDC: 'multicast'*/
dist/Launch-src/java_net_URIHelper.m:    /* LDC: 'multicast'*/
guava:boardspace-5.49 davedyer$ 
ddyer
  • 1,792
  • 19
  • 26