Massimiliano S
-
Content Count
29 -
Joined
-
Last visited
Posts posted by Massimiliano S
-
-
On 10/24/2020 at 6:52 AM, Dave Nottage said:If you have not seen already, Chris Pimlott appears to have beaten me to it:
Hi Dave,
finally after a long time I managed to solve
Thanks a lot to you, Chris and Allen. Without you I wouldn't have been able to do it.
You are great developers and great peopleMassimiliano
- 1
-
8 hours ago, Dave Nottage said:If you have not seen already, Chris Pimlott appears to have beaten me to it:
Thank you very much Dave, I'm going to try and finally hope to succeed.
Chris's post is really complete and accurate and you at Allen have helped me a lot too -
Hi Dave,
1 hour ago, Dave Nottage said:You mean it's possible to use an extension of the type you're using in a Xamarin project? Can you find out what their build process does?
Yes in Xamarin it is possible but I haven't tried it yet.
1 hour ago, Dave Nottage said:I'd like to be able to help you solve this. Can you confirm that the extension you created is exactly the one I asked about earlier? i.e.
You would really do me a huge favor. Yes, I can confirm it
-
Unfortunately following this POST I have not been able to create the archive file and I have stopped for two months on this problem.
In fact, if I copy the whole PlugIns folder and insert the references in the deployment I always get this error:
[PAClient Error] Error: E0776 error: exportArchive: "yashare.appex" requires a provisioning profile.
[PAClient Error] Error: E0776 Error Domain=IDEProvisioningErrorDomain Code=9 ""yashare.appex" requires a provisioning profile." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription="yashare.appex" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}
the PlugIns folder contains a yashare.appex folder which contains:
- yashare
- Info.plist
- embedded.mobileprovision
- Base.lproj \ MainInterface.storyboardc \ Info.plist
- Base.lproj \ MainInterface.storyboardc \ j1y-V4-xli-view-wbc-yd-nQP.nib
- Base.lproj \ MainInterface.storyboardc \ UIViewController-j1y-V4-xli.nib
- _CodeSignature \ CodeResources
I tried with Ad Hoc mode but it's the same with Store mode.
After creation of: all provisioning prodiles, parallel solution in xcode, certificates, Group etc .. What I have done is
- Build in xCode (maybe something wrong here)
- Copy the Plugins folder to my delphi project folder
- Map all files in the deployment
- Compile the Delphi version for Ad Hoc
Last month I found this POST on Quality Center of embarcadero
https://quality.embarcadero.com/browse/RSP-23804
Chris Pimlott seems to have had the same problem as mine and says Delphi is unable to add provisioning profile to plugIn
He suggested an alternative method, that is to generate an Archive file in xCode with the parallel solution, from here extract the exportOptions.plist file, then from the command line on a mac launch a script with the various steps to create the archive with xcodebuild
Unfortunately this solution also gives me an error and I always get this message
2020-09-10 16: 58: 54.881 xcodebuild [2882: 120742] [MT] IDEDistributionMethodManager: - [IDEDistributionMethodManager orderedDistributionMethodsForTask: archive:]: Error = Error Domain = IDEDistributionMethodManagerErrorDomain CodeInfo User Error = 2 "Unknown Distribution Error"
{NSLocalizedDescription = Unknown Distribution Error} error: exportArchive: exportOptionsPlist error for key 'method': expected one of {}, but found ad-hoc
Error Domain = IDEFoundationErrorDomain Code = 1 "exportOptionsPlist error for key 'method': expected one of {}, but found ad-hoc" UserInfo = {NSLocalizedDescription = exportOptionsPlist error for key 'method': expected one of {}, but found ad -hoc}
Here, too, I'm probably doing something wrong but I don't know what. The idea I got, however, is that I am questioning delphi as a tool for developing apps. There is no documentation on App extensions even if they are very used and from embarcadero I have not had any support. At Xamarin I know that all these obstacles have overcome them
-
Here the Exception
procedure TBitmap.LoadFromFile(const AFileName: string);
var
Surf: TBitmapSurface;
begin
TMonitor.Enter(Self);
try
Surf := TBitmapSurface.Create;
tryif TBitmapCodecManager.LoadFromFile(AFileName, Surf, CanvasClass.GetAttribute(TCanvasAttribute.MaxBitmapSize)) then
Assign(Surf) -
Hi,
After updating to delphi 10.4 and SDK 29 the camera and gallery do not work on Android 10
Also delphi examples don't work.After taking a photo from the camera the app doesn't return anything while the gallery, after choosing the photo, raises this execption
First chance exception at $ 00000074D87D473C. Exception class EBitmapLoadingFailed with message 'Loading bitmap failed (/data/user/0/com.embarcadero.CameraRoll/cache/IMG_20200911_1728082355078942815963051.jpg).'. Process CameraRoll.apk (11714)
any ideas?
-
Unfortunately there is no solution.
I had to uninstall delphi 10.3 and install 10.4
This isn't cool because 10.3.3 is ultimately very recent and it can't possibly not support the latest minimal APIs -
Update
I created the group with an administrator profile.
Now I tried to do a test by uploading an empty app to the store (instead of mine in delphi) and my real extension.
The upload worked so the problem seems to be related to delphi.
If in the deployment I also enable embedded.mobieprovisioning then Delphi gives me the error
[PAClient Error] Error: E0776 Error Domain=IDEProvisioningErrorDomain Code=9 ""yashare.appex" requires a provisioning profile with the App Groups feature." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription="yashare.appex" requires a provisioning profile with the App Groups feature., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}
If instead I exclude it then Delphi creates the IPA file for me but during loading APPLE gives me this error
ERROR ITMS-90164: "Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: '4WXQVJ6QJ7.it.diesys.youaddict.yashare' for the key 'application-identifier' in 'Payload/YaApp.app/PlugIns/yashare.appex/yashare'."
maybe there is something wrong with embedded.mobieprovisioning file or I need to change something in the Delphi deployment, I don’t Know
-
Hi,
I created the Share extension type app in xcode and embedded it into my delphi project.
After solving all the problems described above everything works in development and ad hoc. (thanks Dave and special thanks to Allen)
But I had to remove the appex "embedded.mobileprovision" from the deployment:In App Store mode
When I compile for the app store if I also enter "embedded.mobileprovision" in deployment tthen I get this error.
[PAClient Error] Error: E0776 Error Domain=IDEProvisioningErrorDomain Code=9 ""yashare.appex" requires a provisioning profile with the App Groups feature." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription="yashare.appex" requires a provisioning profile with the App Groups feature., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}
I checked the provisionings they are correct,s . both (app and extension) supports group
If I disable "embedded.mobileprovision" for appex in deployment then delphi compiles the ipa correctly, however, when I try to upload IPA files to the store I get this error.
ERROR ITMS-90164: "Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: '4WXQVJ6QJ7.it.diesys.youaddict.yashare' for the key 'application-identifier' in 'Payload/YaApp.app/PlugIns/yashare.appex/yashare'."
In xcode everything looks fine
Extension
App
-
Hello
I need to upload a test app on the google store.
Unfortunately, the loading is not successful because Google requires at least a Level 29 for Android 10 as the target of the API while mine is 28.
I am using delphi rio 10.3.3I updated the SDKs by also installing 29 and downloaded the android-ndk-r21d NDK version.
I then updated SDK manager set as android-29 target.
Unfortunately, delphi always compiles by setting in the manifest:
<uses-sdk android: minSdkVersion = "19" android: targetSdkVersion = "28" />So I forced version 29 in the manifest template but unfortunately the app crashes
I read that Delphi RIO theoretically supported the Android 10 version but I could not find anything about my problem other than a 6 month old post with no solution
Has anyone found this problem yet?Thanks
Massimiliano
-
Update
if I compile in Ad hoc on xCode with the same provisioning it goes to all devices.
When I am delphi it can only be installed on mine -
When I compile in ad hoc mode even if the provisioning contains several devices, the app can only be installed on my iPhone while on the others the installation fails.
using https://www.diawi.com/ and direct connect for installing app.
This did not happen before inserting of a Share Extension made in xCode.
Another strange thing, when I do a share somthing with my iPhone and my app I see a notification on my mac's safari
When I compile with delphi in ad hoc mode, even if I connect another phone (included in the provisioning), the app is reinstalled on my remote and as a Target device in delphi I have always and only my phone and I cannot remove it.
The provisionings are correct (in delphi and xCode) and until yesterday they have always worked, my doubt is that it is something left inside the xCode project but I don't know what. I have searched everywhere.
Bye
Massimiliano
-
Hi Allen,
received email, thank you very much
My app must listen to receive links (both closed and open) and it is not necessary to send anything to the extension.
Does this mean your app must open/run if it’s not running when the extension needs it?
Yes, if my app is closed it should open automatically when a link arrives
A bit like android intents and a bit like other apps do (e.g. notes etc ..)Where should I insert this code? Now what I have to do is send the Link, how do I capture and send it?
I have never made this type of app extension, so I am not sure where you place the code on XCode side until I know what extension you are making. Each app extension works differently.
I have seen that this extension has 2 methods
IsContentValid
didSelectedPost
The first I think should be implemented with the controls on the selected content
The second should send the place (I suppose)Then there is a configurationItems
Are you making a “share” extension for Safari? Are you trying to capture all urls from Safari into your app? Could you explain what you are doing a little bit better? If you could clarify I might be able to advise you where to capture what you want to capture.
The precise operation is as follows:
- The user browses the websites and when he finds a site he likes, he shares it with my app.
- My app must simply receive only a url that runs to a web services that I have made and that extracts from the site the name and some information that may be useful to the user.
- For example, I browse the site
- https://www.zara.com/it/it/donna-borse-pelle-l1041.html?v1=1549268
- I see this bag that I like and I decide to save it.
- My app receives this link, processes it and saves it into a personal database
So the only information needed is the site address and perhaps the name
-
8 hours ago, Allen@Grijjy said:Hello Massimillano,
I sent you an email this morning but it said you were "out of the office". The article shows how to use XPC to exchange the information with your extension. All the code required to do that is included in the blog article, it's not much.
The strange part is you have to create an "Application group" in the Apple developer portal and then add it to your info.plist in order to use XPC (inter-process communication between the app and the extension)
Let me know if you have any questions
Hi Allen, Hi Dave
I received, thank you very much, yes in theory I should be on vacation with my children but until I close this problem I'm blocked.I created a group on apple and managed to put my share exension in delphi and compile.
The problem is that now my share extension and my app in delphi are two empty boxes. Probably now the most is done but I don't know xcode and I'm struggling a bit.If I now run my app on the iPhone the strange thing is that if I share a safari link to my app what happens is that the same site opens for me on the mac
So the first thing to do is work on the app.
My app must listen to receive links (both closed and open) and it is not necessary to send anything to the extension.To do this I have to enter this code but it is not clear where. In the OnCreate of the main form?
var
Defaults: NSUserDefaults;
SharedSettings: MissingNSUserDefaults;
begin
{ Init with the proper Application Group suite name }
Defaults := TNSUserDefaults.Alloc;
SharedSettings := TMissingNSUserDefaults.Wrap((Defaults as ILocalObject).GetObjectID);
SharedSettings.initWithSuiteName(StrToNSStr('group.it.diesys.yadiesys'));
I think this part is used to send data to the Share Extension and therefore in my case it should not be necessary, right?
{ Save SomeKey/SomeValue to the shared settings }
SharedSettings.setObject(
(StrToNSStr('SomeValue') as ILocalObject).GetObjectID,
StrToNSStr('SomeKey') );
{ Update the settings }
SharedSettings.synchronize;
Should the synchronize be called every time something is sent?
How does the app know when a link is sent to it?
and how can I extract it?
Now comes the more complex part because I don't know xCode
If I open my Extension I only have a file a ShareViewController.h file with the interface and a ShareViewController.m that implements the interface.#import "ShareViewController.h"
@interface ShareViewController ()
@end
@implementation ShareViewController
- (BOOL)isContentValid {
// Do validation of contentText and/or NSExtensionContext attachments here
return YES;
}
- (void)didSelectPost {
// This is called after the user selects Post. Do the upload of contentText and/or NSExtensionContext attachments.
// Inform the host that we're done, so it un-blocks its UI. Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context.
[self.extensionContext completeRequestReturningItems:@[] completionHandler:nil];
}
- (NSArray *)configurationItems {
// To add configuration options via table cells at the bottom of the sheet, return an array of SLComposeSheetConfigurationItem here.
return @[];
}
@end
Where should I insert this code?
NSString *const AppGroupName = @" group.it.diesys.yadiesys'";
This shouldn't be necessary because my Extension just has to send, right?
// Settings passed from the host application
NSString *someValue;
Where should I insert this code?
// Create and share access to an NSUserDefaults object
NSUserDefaults *sharedSettings = [[NSUserDefaults alloc] initWithSuiteName: AppGroupName];
Now what I have to do is send the Link, how do I capture and send it?
Thank you very much
Massimiliano
-
Hi dave,
sorry it's always me and I would love to repay you for your precious help
I was able to compile the plug in and make IOS see my app in the share.
Now unfortunately I have to complete the code but I have problems doing it and the example is not very clear to me
https://blog.grijjy.com/2018/11/15/ios-and-macos-app-extensions-with-delphi/What I need to do is put the code in xcode to send the link in my plugin
and put the code in delphi in my app to get the code.
Do you have any tips or an example already done?Then if you come to Italy I will have to offer you a drink
Here the code of my plug .it
#import "ShareViewController.h"
@interface ShareViewController ()
@end
@implementation ShareViewController
- (BOOL)isContentValid {
// Do validation of contentText and/or NSExtensionContext attachments here
return YES;
}
- (void)didSelectPost {
// This is called after the user selects Post. Do the upload of contentText and/or NSExtensionContext attachments.
// Inform the host that we're done, so it un-blocks its UI. Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context.
[self.extensionContext completeRequestReturningItems:@[] completionHandler:nil];
}
- (NSArray *)configurationItems {
// To add configuration options via table cells at the bottom of the sheet, return an array of SLComposeSheetConfigurationItem here.
return @[];
}
@end
-
On 7/8/2020 at 23:46, Dave Nottage said:Non sono sicuro che ci sia qualcosa per risolvere il suo problema, ma grazie per il plug 🙂
Ho la sensazione che sia una semplice voce nel manifesto. Aggiunto alla mia già vasta lista di cose da fare.
Hi Dave,
Do you have any hints and tips on what to look for?
I'm stuck and on the various other forums (also Idera/Emarcadero) I'm not getting any response,
eternally gratefulMAx
-
Thank you,
unfortunately it does not solve the problem.
The problem would seem to be related to the fact that Chrome opens the app internally within a custom tab, but it is a hypothesis
If I use other browsers such as Dolphin, the intent is managed whether the app is closed or already open.On the other hand, if Chrome finds the app open, it still launches a second instance internally which, however, remains blocked on the splash form until I close the first app
I have seen that Chrome also behaves like this with all the other apps (gmail, whats app etc ..) which, however, are still able to manage the call
I tried to modify the manifest, the launchmode but I can't prevent this or manage the double execution anyway.
I am now working on a test app and then port the change to mine which uses the same principle, but this issue is blocking for release
I tried to declare a second activity different from main but I didn't find how to register the action. It is seen by chrome in shared panel but it is not launched.here i found some configurations to put in the manifest but nothing seems to work
https://developer.android.com/guide/topics/manifest/activity-element#embedded
I thought about trying with the remote services but I don't know if a service can manage the share from chrome and if it solves the problem. Or are there other possibilities?
I enclose the project if it can be clearer where I am going to save all the steps that are made in a text file.Thank you very much for your availability
-
Hello,
Thanks a lot for the answer
The problem is that I have changed my manifest from<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="text/pas" />
</intent-filter>to
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/*" />
<data android:mimeType="message/*" />
<data android:mimeType="multipart/*" />
<data android:mimeType="text/*" />
</intent-filter>In order to have the ability to receive shared links from chrome
When the app is closed everything works and after the first share app is launched, but when the app is already open Chrome opens a second instance internally and the app hangs on the splash until I close the already open appUsing this example I have the same problem Like my app, when the app is already open the intent is not managed and the app remains blocked
Kind regards
Max
-
I'm looking at this example because my app stops when it receives an intent if the app is already running
The example says:
ReceiveIntent
ReceiveIntent project has one source file, Unit1.pas. It receives and shows the text from the SendIntent application.
-
HandleIntentAction function verifies that the intent contains information and shows the text on the TMemo1.
-
HandleAppEvent function verifies that the intent is not null and calls HandleIntentAction function with the received itent. This function handles the intent the first time ReceiveIntent opens.
-
ReceiveIntent procedure handles the intent when ReceiveIntent is already open. The itent is register using
MainActivity.registerIntentAction(TJIntent.JavaClass.ACTION_VIEW);
.To receive simple data from other applications, you need to update the Android Manifest file to create the intent filters that are necessary to receive intents for a specific action. After editing the Android Manifest for a specific action, when SendIntent application tries to share the information passing the intent tostartActivity()
, ReceiveIntent appears as the option to view this information. If more than one options is available, an app chooser with all the apps appears.
Unfortunately I don't see this procedure ReceiveIntent
do you know how to handle this situation?
Thanks
Max
-
-
Hi,
I have an app that receives web url sharing via intent.
When I share from all apps or from any browser, my app receives the content and processes it correctly. If the app is not already open then it is successfully launched.
When I share with chrome the app is instead opened in chrome and if the app is already running it stops responding until I close the previous instance already activeHere my Manifest template
<application android:persistent="%persistent%"
android:restoreAnyVersion="%restoreAnyVersion%"
android:label="%label%"
android:debuggable="%debuggable%"
android:largeHeap="%largeHeap%"
android:icon="%icon%"
android:theme="%theme%"
android:usesCleartextTraffic="true"
android:hardwareAccelerated="%hardwareAccelerated%"
android:resizeableActivity="false"><%provider%>
<%application-meta-data%>
<%uses-libraries%>
<%services%>
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
android:label="%activityLabel%"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
android:allowTaskReparenting="true"
android:launchMode="singleTask">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="%libNameValue%" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/*" />
<data android:mimeType="message/*" />
<data android:mimeType="multipart/*" />
<data android:mimeType="text/*" />
</intent-filter>
</activity>
<%activity%>
<%receivers%>
</application>OnCreate of Main Form
{$IFDEF ANDROID}
ContaIntent := 0;if TPlatformServices.Current.SupportsPlatformService
(IFMXApplicationEventService, AppEventService) then
AppEventService.SetApplicationEventHandler(HandleAppEvent);MainActivity.registerIntentAction(TJIntent.JavaClass.ACTION_VIEW);
MainActivity.registerIntentAction(TJIntent.JavaClass.ACTION_SEND);TMessageManager.DefaultManager.SubscribeToMessage
(TMessageReceivedNotification, HandleActivityMessage);
{$ENDIF}Thanks
-
Hi Dave,
thank you very much for your reply, you are very kind
I confirm that I have not enabled universal binary and that I am compiling only 64 bit
I have attached a test application.
The PlugIn was done with Visual Studio code 11.4 and SDK 13.5
The delphi project (this test but also the final one) is with Rio 10.3.3. and SDK 13.5If I compile in delphi the project without plugIn works
If I compile the app in xCode with the Share Extension it works
If I compile the delphi project with the Share Extension compiles correctly but then the app does not start and says that it needs to be updatedBye
Massimiliano
-
Hi Dave,
For now I have circumvented the problem of certificates but now I am stuck on another point.
- I created the extension app in xCode 11.4 on Catalina using SDK 13.5 I used an Ad Hoc profile
- I copied the PlugIns folder into my delphi 10.3.3 application with SDK 13.5
- I tried to compile and install the 64 Bit app as it is and it works
- added the PlugIns folder with all the sub folders to the deployment using the Deployman.exe tool
- I compiled the 64 Bit app and delphi compiles correctly
- I installed the app on the phone but I get the following message:
"this app needs to be updated by the developer to work on this version of IOS"
Reading on the Internet it would seem linked to the fact that 32-bit apps are no longer supported but I have compiled everything 64-bit and the problem occurs only when I import the PlugIns folder
Even in xCode it should compile only 64 Bit if I'm not mistaken
Can you give me some advice?
-
Hi Dave,
I have the problem with both Ad Hoc and Store
-
Hi Dave,
I followed your article and created an empty project in xCode with the same BundleID as my delphi project.
Then I created a share extension app extension in xcode, I compiled in development mode and everything went well When I set up the ad hoc mode xCode asked me to specify the TeamID.
I copied the contents of the PlugIns folder inside my delphi folder and I used your tools to add it to the deployment
Unfortunately now when I compile I find myself in front of another obstacle because I receive this message And unfortunately, I have found almost nothing for Tokyo and Rio about this problem.
[PAClient Error] Error: E0776 2020-07-16 19:39:51.200 xcodebuild[2174:173287] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/c1/9bp_6p2551799vynm572wy5r0000gn/T/YaApple_2020-07-16_19-39-51.199.xcdistributionlogs'.
[PAClient Error] Error: E0776 error: exportArchive: No 'teamID' specified and no team ID found in the archive
[PAClient Error] Error: E0776 Error Domain=IDEFoundationErrorDomain Code=1 "No 'teamID' specified and no team ID found in the archive" UserInfo={NSLocalizedDescription=No 'teamID' specified and no team ID found in the archive}
has this ever happened to you?
I found few posts without solutions
When I have overcome this obstacle I will have to understand how to make my app read the data received from the extension
Firemonkey - Bitmap and memory problem in ListBox
in FMX
Posted
in firemonkey I save locally (win, IOS, Android) some Bitmaps in Jpeg format and reducing the quality and size. In this way 3 or 4 Mb files become 100 or 200Kb
When I reload these files at runtime in a TBitmap of a Trectangle that I insert in a TListBoxItem, the RAM occupied is a lot, sometimes even 20 Mb. The result is that if I have to upload 150 files for a total of 20 Mb on the disk in memory I find myself occupying almost 600 Mb. Does anyone know why and how to decrease the occupation in memory?
Thanks