{"id":21044493,"url":"https://github.com/goronfreeman/ffs","last_synced_at":"2025-07-08T03:39:58.814Z","repository":{"id":56846283,"uuid":"82142672","full_name":"goronfreeman/ffs","owner":"goronfreeman","description":"Fast Firebase sharing for Ruby.","archived":false,"fork":false,"pushed_at":"2017-02-22T07:16:21.000Z","size":45,"stargazers_count":0,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T02:39:03.679Z","etag":null,"topics":["firebase","rails","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goronfreeman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-16T05:25:06.000Z","updated_at":"2017-02-16T05:28:04.000Z","dependencies_parsed_at":"2022-09-09T00:52:43.426Z","dependency_job_id":null,"html_url":"https://github.com/goronfreeman/ffs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goronfreeman%2Fffs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goronfreeman%2Fffs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goronfreeman%2Fffs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goronfreeman%2Fffs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goronfreeman","download_url":"https://codeload.github.com/goronfreeman/ffs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254388332,"owners_count":22063031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","rails","ruby"],"created_at":"2024-11-19T14:17:02.987Z","updated_at":"2025-05-15T17:32:53.438Z","avatar_url":"https://github.com/goronfreeman.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FFS\n\nFFS provides a quick and flexible way to get up and running with\n[Firebase Dynamic Links](https://firebase.google.com/docs/dynamic-links/)\nthrough a minimal API.\n\n## Installation\n\nFFS works with Rails 4.1 onwards. Add it to your Gemfile with:\n\n```ruby\ngem 'ffs'\n```\n\nThen run `bundle install`.\n\nNext, run the generator to create the initializer:\n\n```ruby\n$ rails generate f_f_s:install\n```\n\nOnce the generator completes, you will be presented with instructions to\ncomplete the setup of FFS. You will need to set up your application's settings\nin `config/initializers/ffs.rb`. A minimal configuration utilizing Firebase's\nlink shortening and accommodating Android and iOS can be seen here:\n\n```ruby\nFFS.configure do |config|\n  # ==\u003e General configuration\n  config.firebase_api_key = 'my_firebase_api_key'\n  config.dynamic_link_domain = 'mydomain.app.goo.gl'\n  config.suffix = 'SHORT'\n\n  # ==\u003e Android configuration\n  config.android_package_name = 'my_package_name'\n\n  # ==\u003e iOS configuration\n  config.ios_bundle_id = 'my_bundle_id'\n  config.ios_app_store_id = 'my_app_store_id'\nend\n```\n\nYou should utilize environment variables for any API keys and other sensitive\ninformation you don't want made public.\nFor a full explanation of each configuration option, check the\n[Firebase dynamic links documentation](https://firebase.google.com/docs/reference/dynamic-links/link-shortener).\n\n## Usage\n\nFFS provides a single public method to generate your dynamic link. After customizing the initializer to your needs, create a new instance of `FFS::Share`:\n\n```ruby\nffs = FFS::Share.new\n```\n\nNext, call `#generate_dynamic_link`, which takes two arguments: A hash containing basic information to be displayed when your link is shared to a social network, and an optional hash to turn features off and on, depending on your needs. Here's an example utilizing `#generate_dynamic_link`'s default options:\n\n```ruby\nlink_info = {\n  link: 'www.example.com/user/1',\n  socialMetaTagInfo: {\n    socialTitle: 'My Social Media Title',\n    socialDescription: 'Description of the thing being shared.',\n    socialImageLink: 'http://i.imgur.com/d5ByxBl.png'\n  }\n}\n\nffs.generate_dynamic_link(link_info)\n```\n\nThis returns a hash containing the short link and a link to view a flowchart of\nwhere the link will take you in a variety of situations.\n\n```ruby\n{\n  \"shortLink\": \"https://yourdomain.app.goo.gl/randomString\",\n  \"previewLink\": \"https://yourdomain.app.goo.gl/?link=http://www.example.com\u0026apn=com.example.hello\"\n}\n```\n\n![Flowchart](http://i.imgur.com/qanlwcs.png)\n\n### Advanced Usage\n\nImagine we have this model:\n\n```ruby\nclass Author \u003c ApplicationRecord\n  validates :name, :bio, :picture\nend\n```\n\nWe want to pass this object to FFS to create a shareable link to post to Twitter.\nSince `#generate_dynamic_link` takes a hash as its first argument, it allows\nus to do this:\n\n```ruby\nwalt = Author.new(\n  name: 'Walt Whitman',\n  bio: 'American poet, essayist, and journalist.',\n  picture: 'walt.jpg'\n)\nffs = FFS::Share.new\n\ndef author_info(author)\n  {\n    link: \"www.example.com/author/#{author.id}\",\n    socialMetaTagInfo: {\n      socialTitle: author.name,\n      socialDescription: author.bio,\n      socialImageLink: author.picture\n    }\n  }\nend\n\nlink_info = author_info(walt)\n\nffs.generate_dynamic_link(link_info)\n```\n\n### Options\n\nBelow is a table of options you can pass to `#generate_dynamic_link`, along with their default value:\n\n| Option  | Default Value | Description |\n| ------------- | ------------- | ------------- |\n| android  | true | Include metadata for Android. |\n| ios | true | Include metadata for iOS. |\n| min_package | false | Restrict the dynamic link to certain app versions. (Android) |\n| ipad | false | Include separate metadata for iPad |\n| custom_scheme | false | Define a custom URL scheme for your app. (iOS) |\n| fallback | false | Provide a link to open when the app isn't installed. |\n| analytics | false | Collect analytics using Google Play and/or iTunes. |\n| bitly | false | Use Bitly for link shortening instead of Firebase. |\n\nUtilize options like this:\n\n```ruby\nffs = FFS::Share.new\n\n# We don't need metadata for iOS, want Google Play analytics, and want to use Bitly.\nffs.generate_dynamic_link(link_info, ios: false, analytics: true, bitly: true)\n```\n\nDetailed explanations can be found in the\n[Firebase documentation](https://firebase.google.com/docs/reference/dynamic-links/link-shortener#parameters)\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/goronfreeman/ffs.\n\n## License\n\nMIT\n\nCopyright (c) 2017 Hunter Braun\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoronfreeman%2Fffs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoronfreeman%2Fffs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoronfreeman%2Fffs/lists"}