-
-
Notifications
You must be signed in to change notification settings - Fork 136
Error with sharing #152
Comments
Is it possible that the file is renamed to text.txt and the other json file was already there before? |
My code is quite straight forward and I personally don't see it happening at the Unity level. I am not sure about whether its happening on the plugin side or not. |
I've seen entries mentioning the saved file automatically being renamed to text.txt but never seen any entries where text.txt was duplicated. Please delete both text.txt and the other json file and try again. |
Can you tell me how can I verify on my side like where it's being renamed to text.txt? |
Like I mentioned earlier its only happened when I press "save to folder " in dialogue box besides that if try to copy or save to note in Ipad it shows me one file |
You can verify it by deleting txt and json from the folder and saving to that folder again. If only txt exists, then the file is renamed. |
there is only one file in the folder I Debuged the path of file when pressing the AddFile Event in Xcode and its only one call to addFile and one debug |
What I'm trying to say is, if when you click the "Save to Files" button, you are saving the file to say X folder, then please delete both txt and json from that X folder and try again. I'm suspecting that the json file in the X folder was present there beforehand and that made you think that calling Share function added both a json and a txt file to X folder whereas in reality, it only added a txt file to the X folder. |
No! I totally understand your Point when I try to click "Save to Files" button at the time "X Folder " which I am pointing to is totally empty. When you press "Save to Files" it shows me that on top of "2 Items" and the I proceeded to select X folder which is right below the name. |
and I only sent one call to Add a file in Unity which I debugged in Xcode and is precisely only one call and the path I use in AddFile() method is exactly the path to JSON file. What I am confused about is where did this "text.txt" file come from When I am not even creating this file. Is this something happening at plugin level? |
Thank you for letting me know about this. I believe you can use SetCallback without any issues. This must be related to SetSubject only. I'll research some more to see how it can be resolved. |
Can you change these lines with the following code (you can do that in Xcode by modifying NativeShare.mm for testing purposes) and see if it resolves the issue: - (id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(NSString *)activityType
{
return [activityType isEqualToString:@"com.apple.CloudDocsUI.AddToiCloudDrive"] ? nil : [self body];
}
- (NSString *)activityViewController:(UIActivityViewController *)activityViewController subjectForActivityType:(NSString *)activityType
{
return [activityType isEqualToString:@"com.apple.CloudDocsUI.AddToiCloudDrive"] ? nil : [self subject];
} |
I am using this block of code to share my json file on Ipad. When I am on the main dialogue Only one json file with a name is being appeared and I am also checking the number of files I have in files list while doing this
But the problem is when I press "Save to Files" It adds an additional file of "text.txt" so as result it saves two files on the drive instead of just my exported json file.
I am confused why is this happening. To test my case what I did was I tried to mail and copy the file and it was not adding any extra files Instead I was getting the only file that I was wanted which is the desired result.
The text was updated successfully, but these errors were encountered: