GithubHelp home page GithubHelp logo

shin-nil / godot-share Goto Github PK

View Code? Open in Web Editor NEW
69.0 7.0 19.0 245 KB

Simple share text and/or image module for Godot Engine (Android & iOS)

License: MIT License

Java 27.10% Python 7.41% C++ 16.70% Objective-C++ 47.89% C 0.89%
godot module share android ios image text

godot-share's People

Contributors

kyoz avatar novalis avatar shin-nil avatar theankurpanchani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

godot-share's Issues

ipad Share does not work

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

sharePic function not working on Godot 3.0.2 and Android

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

Android build issue (androidx.core.v4.content does not exist)

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.

  • What went wrong:
    Execution failed for task ':compileDebugJavaWithJavac'.

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

Android build issue 3.x

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")

Compiling for Android issues

I'm using godot 3.1 and i download latest godot source code.

Drop the "share" directory inside the "modules" directory on the Godot source.

after compile godot_master code

Screen Shot 2019-05-13 at 12 11 25 PM

Can you help me with this? What i'm doing wrong?

Compiling for Android

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)?

share HTML document request

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

godot 4 integration

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

iOS recognize the module but doesn't show

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?

Sharing custom files?

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.

Share for iOS for Godot 3.5

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?

Fail To Run In Android 6,7

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+

iOS build issue Godot 3.x

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.

Unable to run in iOS? getting errors

I'm using godot 3.1 and i download latest godot source code from Link.

Then i follow the steps:

  1. Copy share folder to godot/modules folder.

  2. 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

  1. After i used following command to generate *.debug.fat.a file.
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.

  1. i replaced libgodot.iphone.debug.fat.a file into godot/misc/dist/ios_xcode folder

  2. i copied ios_xcode folder in documents, rename ios_xcode to iphone, then zip it. i get result file iphone.zip in Document folder.

  3. Then i add iphone.zip file to Project>Export>Options>Custom Package>Debug

    https://imgur.com/9rV78v7

  4. Then Export project.

Error:

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.