The problem: any tethered app that I create in Delphi XE10 works only when both apps are run on the same machine (PC or Mac) or with a Mac/ios pairing. PC/mac and PC/ios fail. I've tried the MediaPlayer samples that come with RAD Studio XE10 (in C:\Users\Public\Documents\Embarcadero\Studio\17.0\Samples\Object Pascal\Multi-Device Samples\Device Sensors and Services\App Tethering) and it fails to connect in the same way (fails with PC/Mac and PC/ios). Since the PC seems to be the common factor, I thought this might be a firewall problem but nothing looked out of place and I even tried this with the firewall turned off and it still didn't work)
For some actual code, I'll use a sample from a tutorial that also fails in the same way for me: (Tutorial available: http://www.malcolmgroves.com/blog/?p=1854)
- Start with two multi-device (firemonkey) applications (app1 and app2) - create each in a separate instance of Delphi XE10
- In both, drop in a TetheringManager and a TetheringAppProfile.
- In both, Select your TetheringManager as the Manager in the TetheringAppProfile
- In App1 drop in a button and a label
- In App2 drop in a label
- in App2 set the password for the TetheringManager to The wingless dove protects its nest
App1 Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
TetheringManager1.AutoConnect();
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Caption := format('App1 : %s', [tetheringmanager1.Identifier]);
end;
procedure TForm1.TetheringManager1PairedToRemote(const Sender: TObject; const AManagerInfo: TTetheringManagerInfo);
begin
label1.Text := Format('Connected : %s %s', [amanagerinfo.ManagerIdentifier, amanagerinfo.ManagerName]);
end;
procedure TForm1.TetheringManager1RequestManagerPassword(const Sender: TObject; const ARemoteIdentifier: string; var Password: string);
begin
Password := 'The wingless dove protects its nest';
end;
App2 Code:
procedure TForm1.FormCreate(Sender: TObject);
begin
caption := format('App2 : %s', [tetheringmanager1.Identifier]);
end;
procedure TForm1.TetheringManager1PairedFromLocal(const Sender: TObject; const AManagerInfo: TTetheringManagerInfo);
begin
label1.Text := Format('Connected : %s %s', [amanagerinfo.ManagerIdentifier, amanagerinfo.ManagerName]);
end;
When compiled/built/deployed the behavior differs depending on the targets as discussed above and charted below.
+---------------------------+
| App1 | App2 | Outcome |
+-------+-------+-----------+
| PC1 | PC1 | success |
+-------+-------+-----------+
| PC1 | Mac | Failure |
+-------+-------+-----------+
| PC1 | ios | Failure |
+-------+-------+-----------+
| ios | PC1 | Failure |
+-------+-------+-----------+
| ios | Mac | Failure |
+-------+-------+-----------+
| Mac | ios | Success |
+-------+-------+-----------+
| Mac | Mac | Success |
+-------+-------+-----------+
| Mac | PC1 | Failure |
+-------+-------+-----------+
| PC1 | PC2 | Failure |
+-------+-------+-----------+
| PC2 | PC2 | Success |
+-------+-------+-----------+