shin-nil / godot-share Goto Github PK
View Code? Open in Web Editor NEWSimple share text and/or image module for Godot Engine (Android & iOS)
License: MIT License
Simple share text and/or image module for Godot Engine (Android & iOS)
License: MIT License
Hello, i wander if this plugin supports not only Images and Texts but a files
for example, i want to share .csv file
can i do that with that plugin?
thank you.
Ran into this error when trying to build android export template using 3.x branch.
AttributeError: 'SConsEnvironment' object has no attribute 'android_add_java_dir':
File "/Users/kakapoopie/godot/SConstruct", line 534:
config.configure(env)
File "/Users/kakapoopie/godot/modules/share/config.py", line 6:
env.android_add_java_dir("android")
I am trying to try this module for iOS I was able to create the build no errors. I included the code in my game.
`func _ready():
if Engine.has_singleton("GodotShare"):
print('share prepared')
share = Engine.get_singleton("GodotShare")
func _on_ShareBtn_pressed():
#friendPopup.visible = false
if (share != null):
print('sharing')
share.hareText('Friend Code', 'FC', 'A93DK9L')`
When I run the game on my phone I get the messages in console
2020-06-15 14:07:56.848227-0500 Game[1407:4599503] share prepared 2020-06-15 14:08:00.808297-0500 Game[1407:4599503] sharing
But the phone doesn't seem to prompt me anything, is there anything i am missing?
I'm using godot 3.1 and i download latest godot source code from Link.
Then i follow the steps:
Copy share folder to godot/modules folder.
Then i compile for iOS using this Link. I used following command to compile.
scons p=iphone tools=no target=debug arch=arm
scons p=iphone tools=no target=debug arch=arm64
In godot/bin i get as result two files :
libgodot.iphone.debug.arm.a
libgodot.iphone.debug.arm64.a
lipo -create bin/libgodot.iphone.debug.arm64.a bin/libgodot.iphone.debug.arm.a -output bin/libgodot.iphone.debug.fat.a
as result i get libgodot.iphone.debug.fat.a file in godot/bin folder.
i replaced libgodot.iphone.debug.fat.a file into godot/misc/dist/ios_xcode folder
i copied ios_xcode folder in documents, rename ios_xcode to iphone, then zip it. i get result file iphone.zip in Document folder.
Then i add iphone.zip file to Project>Export>Options>Custom Package>Debug
Then Export project.
Undefined symbols for architecture armv7:
"_z_verbose", referenced from:
_inflateInit2_ in FBLogin.a(ftgzip.iphone.debug.arm.o)
_inflate in FBLogin.a(ftgzip.iphone.debug.arm.o)
_inflateEnd in FBLogin.a(ftgzip.iphone.debug.arm.o)
_inflateReset in FBLogin.a(ftgzip.iphone.debug.arm.o)
_inflate_blocks_reset in FBLogin.a(ftgzip.iphone.debug.arm.o)
_inflate_codes_free in FBLogin.a(ftgzip.iphone.debug.arm.o)
_inflate_blocks_new in FBLogin.a(ftgzip.iphone.debug.arm.o)
...
"_z_error", referenced from:
_inflate_codes in FBLogin.a(ftgzip.iphone.debug.arm.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can you help me with this? What i'm doing wrong?
xcode 10.1 used with developer account and running in device.
Sorry to write here, I could not find your contacts. Mail or Telegram
I made such a module (see dev branch). I tried to implement the promoted purchases.
But I have no way to test it. And the knowledge of the Objective-C language is very weak.
Could you help or suggest who could?
Godot version:
3.1-stable
OS/device including version:
Android 6, 7
Compiled on Windows 10
Issue description:
ATAL EXCEPTION: GLThread 557 Process: com.murderintheshadows.aelia, PID: 9604 java.lang.ClassNotFoundException: Didn't find class "org/godotengine/godot/GodotShare" on path: DexPathList[[zip file "/data/app/com.murderintheshadows.aelia-1/base.apk"],nativeLibraryDirectories=[/data/app/com.murderintheshadows.aelia-1/lib/arm64, /data/app/com.murderintheshadows.aelia-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at org.godotengine.godot.GodotLib.setup(Native Method) at org.godotengine.godot.Godot$2.run(Godot.java:311) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1481) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1253) Suppressed: java.lang.ClassNotFoundException: Didn't find class "org/godotengine/godot/GodotFacebook" on path: DexPathList[[zip file "/data/app/com.murderintheshadows.aelia-1/base.apk"],nativeLibraryDirectories=[/data/app/com.murderintheshadows.aelia-1/lib/arm64, /data/app/com.murderintheshadows.aelia-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]] ... 7 more
Steps to reproduce:
You can download the project, compile, export and try to run on android 6, app crashes with error above.
This runs fine on Android 8+
Is it possible to somehow share a sound using this module?
hello,
could you implement a new method to share HTML documents?
Should be nice to use a String as input, perhaps somebody could find useful via file path too.
thanks
Graziano
Hi,
I wonder if a newer version of the share could be made available to use it for newer Godot versions using plugins methods.
Or does anybody know if an alternative to this repo is available?
I tried several times with different versions of the required tools to compile the godot source code so I got a release and debug apk. I succeed the compiling, but the result gives me a way smaller file than the original. Also when I exported my android app, on startup I got short a black screen and than the app crashed.
If you have experience with this issue could you tell me how to fix it. Otherwise (worst case) could you compile this (I don't mind in what godot version you compile it, I'm flexible)?
Since currently there are issues with screen capture in Godot 3, I have modified the demo project a little bit to try this:
func _on_share_btn_pressed():
# if share was found, use it
if share != null:
share.sharePic("res://icon.png", "Image Sharing", "Sharing image with GodotShare", "It's a demo app for testing GodotShare. Do you like it?")
The sharing menu is showing correctly and the title, subject and text are set correctly as well. However, the picture is not attached in any case (Facebook, Whatsapp, Gmail...) and instead an empty box is shown. No errors are shown in the console.
Am I doing something wrong? I have tried this on Godot 3.0.2 and Xiaomi MI5 with Android MIUI.
Thanks
i searched on the internet about this problem and i found many people are facing it ,
the problem is :
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Your application has presented a UIActivityViewController (<UIActivityViewController: 0x107acd200>). In its current trait environment, the modalPresentationStyle of a UIActivityViewController with this style is UIModalPresentationPopover. You must provide location information for this popover through the view controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the view controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.'
the solution :
https://stackoverflow.com/questions/25644054/uiactivityviewcontroller-crashing-on-ios-8-ipads
https://medium.com/@dushyant_db/how-to-present-uiactivityviewcontroller-on-iphone-and-ipad-ae72013d2a5a
Adopted this great plugin for godot integration, forgot to ask permission from original developers (my apologies), let me ask ,ar you ok with it? Please find PR here godotengine/godot#90429
For example I want to give players some rewards to encourage them to share the game.
share.connect("share_done", self, "give_some_reward")
When I try compiling for android getting an error for a library does not exists. Could it be a version error? maybe something i need to make sure i have enabled? I honestly not sure if you need more infotmation to know what is going on so let me know
Here is the error i get
./gradlew build
Configure project :
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Task :compileDebugJavaWithJavac FAILED
/Users/cesar.amaro/Documents/godot-3.1/modules/share/android/GodotShare.java:9: error: package androidx.core.v4.content does not exist
import androidx.core.v4.content.FileProvider;
^
/Users/cesar.amaro/Documents/godot-3.1/modules/share/android/GodotShare.java:52: error: cannot find symbol
uri = FileProvider.getUriForFile(activity, activity.getPackageName(), f);
^
symbol: variable FileProvider
location: class GodotShare
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s
Fails to build with these errors on godot today's 3.x branch
modules/share/ios/src/godotShare.mm:29:10:{29:10-29:25}: error: receiver type 'ViewController' for instance message is a forward declaration [5]
[root_controller presentViewController:avc animated:YES completion:nil];
^~~~~~~~~~~~~~~
platform/iphone/app_delegate.h:33:8: note: forward declaration of class here [2]
@Class ViewController;
^
modules/share/ios/src/godotShare.mm:34:9: warning: 'UIPopoverController' is deprecated: first deprecated in iOS 9.0 - UIPopoverController is deprecated. Popovers are now implemented as UIViewController presentations. Use a modal presentation style of UIModalPresentationPopover and UIPopoverPresentationController. [-Wdeprecated-declarations,34]
UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:avc];
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverController.h:26:12: note: 'UIPopoverController' has been explicitly marked deprecated here [2]
@interface UIPopoverController : NSObject {}
^
modules/share/ios/src/godotShare.mm:34:40: warning: 'UIPopoverController' is deprecated: first deprecated in iOS 9.0 - UIPopoverController is deprecated. Popovers are now implemented as UIViewController presentations. Use a modal presentation style of UIModalPresentationPopover and UIPopoverPresentationController. [-Wdeprecated-declarations,34]
UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:avc];
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverController.h:26:12: note: 'UIPopoverController' has been explicitly marked deprecated here [2]
@interface UIPopoverController : NSObject {}
^
modules/share/ios/src/godotShare.mm:35:66:{35:50-35:65}: error: property 'view' cannot be found in forward class object 'ViewController' [2]
[popup presentPopoverFromRect:CGRectMake(root_controller.view.frame.size.width/2, root_controller.view.frame.size.height/4, 0, 0)inView:root_controller.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
~~~~~~~~~~~~~~~ ^
platform/iphone/app_delegate.h:33:8: note: forward declaration of class here [2]
@Class ViewController;
^
modules/share/ios/src/godotShare.mm:35:107:{35:91-35:106}: error: property 'view' cannot be found in forward class object 'ViewController' [2]
[popup presentPopoverFromRect:CGRectMake(root_controller.view.frame.size.width/2, root_controller.view.frame.size.height/4, 0, 0)inView:root_controller.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
~~~~~~~~~~~~~~~ ^
platform/iphone/app_delegate.h:33:8: note: forward declaration of class here [2]
@Class ViewController;
^
modules/share/ios/src/godotShare.mm:35:161:{35:145-35:160}: error: property 'view' cannot be found in forward class object 'ViewController' [2]
[popup presentPopoverFromRect:CGRectMake(root_controller.view.frame.size.width/2, root_controller.view.frame.size.height/4, 0, 0)inView:root_controller.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
~~~~~~~~~~~~~~~ ^
platform/iphone/app_delegate.h:33:8: note: forward declaration of class here [2]
@Class ViewController;
^
modules/share/ios/src/godotShare.mm:52:10:{52:10-52:25}: error: receiver type 'ViewController' for instance message is a forward declaration [5]
[root_controller presentViewController:avc animated:YES completion:nil];
^~~~~~~~~~~~~~~
platform/iphone/app_delegate.h:33:8: note: forward declaration of class here [2]
@Class ViewController;
^
modules/share/ios/src/godotShare.mm:57:9: warning: 'UIPopoverController' is deprecated: first deprecated in iOS 9.0 - UIPopoverController is deprecated. Popovers are now implemented as UIViewController presentations. Use a modal presentation style of UIModalPresentationPopover and UIPopoverPresentationController. [-Wdeprecated-declarations,34]
UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:avc];
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverController.h:26:12: note: 'UIPopoverController' has been explicitly marked deprecated here [2]
@interface UIPopoverController : NSObject {}
^
modules/share/ios/src/godotShare.mm:57:40: warning: 'UIPopoverController' is deprecated: first deprecated in iOS 9.0 - UIPopoverController is deprecated. Popovers are now implemented as UIViewController presentations. Use a modal presentation style of UIModalPresentationPopover and UIPopoverPresentationController. [-Wdeprecated-declarations,34]
UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:avc];
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverController.h:26:12: note: 'UIPopoverController' has been explicitly marked deprecated here [2]
@interface UIPopoverController : NSObject {}
^
modules/share/ios/src/godotShare.mm:58:66:{58:50-58:65}: error: property 'view' cannot be found in forward class object 'ViewController' [2]
[popup presentPopoverFromRect:CGRectMake(root_controller.view.frame.size.width/2, root_controller.view.frame.size.height/4, 0, 0)inView:root_controller.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
~~~~~~~~~~~~~~~ ^
platform/iphone/app_delegate.h:33:8: note: forward declaration of class here [2]
@Class ViewController;
^
modules/share/ios/src/godotShare.mm:58:107:{58:91-58:106}: error: property 'view' cannot be found in forward class object 'ViewController' [2]
[popup presentPopoverFromRect:CGRectMake(root_controller.view.frame.size.width/2, root_controller.view.frame.size.height/4, 0, 0)inView:root_controller.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
~~~~~~~~~~~~~~~ ^
platform/iphone/app_delegate.h:33:8: note: forward declaration of class here [2]
@Class ViewController;
^
modules/share/ios/src/godotShare.mm:58:161:{58:145-58:160}: error: property 'view' cannot be found in forward class object 'ViewController' [2]
[popup presentPopoverFromRect:CGRectMake(root_controller.view.frame.size.width/2, root_controller.view.frame.size.height/4, 0, 0)inView:root_controller.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
~~~~~~~~~~~~~~~ ^
platform/iphone/app_delegate.h:33:8: note: forward declaration of class here [2]
@Class ViewController;
^
[ 63%] 4 warnings and 8 errors generated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.