Giter Site home page Giter Site logo

ios-pod-specs's Introduction

About

urbanairship is a Ruby library for using the Airship REST API for push notifications, message center messages, email, and SMS.

Requirements

We officially support the following Ruby versions:

2.6.7
2.7.2

Newer 2.x versions should work as well.

Functionality

Version 8.0 is a major upgrade, as we have changed the tested/supported versions of Ruby. A more detailed list of changes can be found in the CHANGELOG.

Questions

The best place to ask questions or report a problem is our support site: http://support.airship.com/

Installation

If you have the bundler gem (if not you can get it with $ gem install bundler) add this line to your application's Gemfile:

>>> $ gem 'urbanairship'

And then execute:

>>> $ bundle

OR install it yourself as:

>>> $ gem install urbanairship

Configuration

In your app initialization, you can do something like the following:

require 'urbanairship'

Urbanairship.configure do |config|
  config.server = 'api.asnapieu.com'
  config.oauth_server = 'oauth2.asnapieu.com'
  config.log_path = '/path/to/your/logfile'
  config.log_level = Logger::WARN
  config.timeout = 60
end

If you want to use a custom logger (e.g Rails.logger), you can do:

require 'urbanairship'

Urbanairship.configure do |config|
  config.custom_logger = Rails.logger
  config.log_level = Logger::WARN
end

Available Configurations

  • log_path: Allows you to define the folder where the log file will be created (the default is nil).
  • log_level: Allows you to define the log level and only messages at that level or higher will be printed (the default is INFO).
  • server: Allows you to define the Airship server you want to use ("api.asnapieu.com" for EU or "api.asnapius.com" for US)
  • oauth_server Allows you to define the Airship Oauth server you want to use ("oauth2.asnapieu.com" for EU or "oauth2.asnapius.com" for US)
  • timeout: Allows you to define the request timeout in seconds (the default is 5).

Usage

Once the gem has been installed you can start sending pushes! See the full documentation, api examples, as well as the Airship API Documentation for more information.

Broadcast to All Devices

require 'urbanairship'

UA = Urbanairship

airship = UA::Client.new(key:'application_key', secret:'master_secret')
p = airship.create_push
p.audience = UA.all
p.notification = UA.notification(alert: 'Hello')
p.device_types = UA.device_types(['ios','android'])
p.send_push

Simple Tag Push

require 'urbanairship'

UA = Urbanairship

airship = UA::Client.new(key:'application_key', secret:'master_secret')
p = airship.create_push
p.audience = UA.tag('some_tag')
p.notification = UA.notification(alert: 'Hello')
p.device_types = UA.device_types(['ios','android'])
p.send_push

Specify the Airship server used to make your requests

By default, the request will be sent to the 'api.asnapius.com' server:

require 'urbanairship'

Urbanairship::Client.new(key:'application_key', secret:'master_secret')

You can change the server globally in the Urbanairship configuration:

require 'urbanairship'

Urbanairship.configure do |config|
  config.server = 'api.asnapieu.com'
end

Urbanairship::Client.new(key:'application_key', secret:'master_secret')
# request will be sent to the 'api.asnapieu.com' server

Finally, you can change the targeted server on a request basis:

require 'urbanairship'

Urbanairship.configure do |config|
  config.server = 'api.asnapieu.com'
end

Urbanairship::Client.new(key:'application_key', secret:'master_secret', server: 'api.asnapius.com')
# The Urbanairship configuration is overridden by the client and the
# request will be sent to the 'api.asnapius.com' server

Using Bearer Token Auth

require 'urbanairship'

UA = Urbanairship
airship = UA::Client.new(key:'application_key', token:'token')
# Then continue as you would otherwise

Note: If you include a token in your instantiation, the request will use bearer token auth. Bearer token auth is required for some endpoints, but not supported by others. Please check the Airship docs site to see where it is supported.

Using Oauth

require 'urbanairship'

UA = Urbanairship
app_key = 'application_key'

oauth = UA::Oauth.new(
  client_id: 'client_id',
  key: app_key,
  assertion_private_key: 'your_private_key',
  scopes: ['psh', 'chn'], # Optional
  ip_addresses: ['23.74.131.15/22'], # Optional
  oauth_server: 'api.asnapieu.com' # Optional
)
airship = UA::Client.new(key: app_key, oauth: oauth)
# Then continue as you would otherwise

Note: You can not use both Oauth and bearer token auth at the same time. Oauth also cannot be used with the older 'api.urbanairship.com' and 'api.airship.eu' base URLs. Lastly there are some endpoints in which Oauth is not supported. Please check the Airship docs site to see where it is supported.

Contributing

  1. Fork it ( https://github.com/urbanairship/ruby-library )
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes git commit -am 'Add some feature'
  4. Push to the branch git push origin my-new-feature
  5. Create a new Pull Request
  6. Sign Airship's contribution agreement.

7. Reach out to our support team at https://support.airship.com to let us know about your PR and your urgency level.

Note: Changes will not be approved and merged without a signed contribution agreement.

Development

After checking out the repo, ensure you have bundler installed ($ gem install bundler) run:

>>> $ bin/setup

to install dependencies. Then, run:

>>> $ bin/console

for an interactive prompt that will allow you to experiment.

OR you can build a local gem to play with:

>>> $ gem build urbanairship.gemspec
>>> $ gem install ./urbanairship-<VERSION>.gem

Having a local build will give you better logging if you are running into issues, but be careful to make sure to use our released public gem in Production.

ios-pod-specs's People

Contributors

aslimacc avatar khmmouna avatar oristanovic avatar ulrico972 avatar yacir avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-pod-specs's Issues

Empty Pod

When I try to use it, we receive a ok installation but on pod we only have support files and cannot import or use it.

image

image

Can't install SDK with CocoaPods

We can't install the Accengage-SDK using CocoaPods. Seems like there are Problems with the SSL configuration on the accengage server.

Steps to reproduce:

  • Delete all CocoaPods caches
  • Run pod install

Error output:

Analyzing dependencies
Downloading dependencies
Installing Accengage-iOS-SDK (6.2.1)

[!] Error installing Accengage-iOS-SDK
[!] /usr/bin/curl -f -L -o /var/folders/1g/srbzk5ks4_q05l6bwfn23vn00000gn/T/d20190416-6418-zwkog2/file.zip https://docs.accengage.com/sdk/ios/AccengageKit-6.2.1.zip --create-dirs --netrc-optional --retry 2

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:01:15 --:--:--     0
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to docs.accengage.com:443

Checksum error in cocoapod

Since your last update the 7th of may, I am getting an error on my CI system :
The podfile.lock contains changes

12:03:52  SPEC CHECKSUMS:
12:03:52 -  Accengage-iOS-SDK: 984688556c22c1b86bfd924963421bd22824743b
12:03:52 +  Accengage-iOS-SDK: 3ca71d11770e9a97be0bc24da9bc3b6f57d92f52

looking at it a bit closer I realised even though I was asking for the 6.1 version in my podfile
pod 'Accengage-iOS-SDK', '~> 6.1'
The installed version in the podfile.lock was 6.3
- Accengage-iOS-SDK (6.3.2)
So I thought I could fix my issue by upgrading to the latest version 6.4 but even when asking :
pod 'Accengage-iOS-SDK', '~> 6.4' and thus installing
`- Accengage-iOS-SDK (6.4.2)``
I find myself with the same issue where the check sum changed in the podfile.lock while installing it on my CI :

10:57:20 -  Accengage-iOS-SDK: cbc7783c79dc5b5094b62cf48f4dafaaabad83c5
10:57:20 +  Accengage-iOS-SDK: ae61bfd76709089ec76dde8266a0d75906b2a45e```

Cocoapods warning

When adding Accengage-iOS-SDK-Extension (v1.1.0), cocoapods issues the following warning:

[!] 'Accengage-iOS-SDK-Extension' uses the unencrypted http protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts in there. Please reach out to the library author to notify them of this security issue.

Cocoapods error installing Accengage-iOS-SDK

Hello. We get this error when running pod install for Accengage.

[!] Error installing Accengage-iOS-SDK
[!] /usr/bin/curl -f -L -o /var/folders/vb/628zbf_924z_2jtx1fmy8rk80000gn/T/d20210520-90232-101jdfk/file.zip https://dl.bintray.com/accengage/iOS/AccengageKit-6.4.1.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.10.1 cocoapods-downloader/1.4.0'

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 403 Forbidden

Please fix it soon. We need it for a release

Pod install doesn't work anymore

Podfile contains:

use_frameworks!
source 'https://github.com/Accengage/ios-pod-specs.git'

and

pod 'Accengage-iOS-SDK'

after runningpod install.

Installing Accengage-iOS-SDK (6.1.2)

[!] Error installing Accengage-iOS-SDK
[!] /usr/bin/curl -f -L -o /var/folders/6n/pjqbkfkd2pl4w96yy_fnlncr0000gn/T/d20180227-32995-140q6nv/file.zip http://docs.accengage.com/sdk/ios/AccengageKit-6.1.2.zip --create-dirs --netrc-optional

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found

How to completely disable all tracking but keep Push notifications on

Since the GDRP went into effect we want to completely disable all user tracking but leave push notifications on. If we call the following functions according to the documentation

Accengage.startWithOpt(.enabled)
Accengage.setDataOptInEnabled(false)

When we call Accengage.push()?.registerForUserNotifications(...) we get the following messages:
BMA4S : Data opt-in disabled.
BMA4S : WARNING: SDK not active. Method called will not execute

So it appears that if the user opts out of data tracking Push notifications are disabled.

This is irregular behavior. Push notifications and user tracking should be two completely separate modules. Please advise on how to disable all user tracking and keep push notifications on.

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.