Giter VIP home page Giter VIP logo

friendlyping's Introduction

Project status

status: inactive

This project is no longer actively maintained, and remains here as an archive of this work.

Friendly Ping

Friendly Ping demonstrates using GCM, Analytics, Sign In and AdMob together in a single application.

You can use this as a reference for how to implement your own basic application.

Getting started

Clone the code of the project:

git clone https://github.com/googlesamples/friendlyPing.git

To get started, you need to enable Google services for your app for at least one of the two available clients.

Android

Get a configuration file for your android app opening the following link in a new tab: https://developers.google.com/mobile/add

Use com.google.samples.apps.friendlyping as package name when creating your project, and enable the following APIs:

  • Google Sign-In
  • Cloud Messaging
  • Analytics
  • AdMob

Download the google-services.json file into friendlyPing/android/app/ If you want to check out the code, open Android Studio, select File > Open, browse to where you cloned the friendlyPing repository, and open friendlyPing/android (if you are in the Android Studio start screen, you can select Open an existing Android Studio project and use this same path). Don't build and run the client until you have one of the server running.

Note: if Android Studio cannot resolve @string/test_banner_ad_unit_id, it should not be a problem and you should still be able to build and run the app.

iOS

Make sure you have CocoaPods.

Open a terminal window and navigate to friendlyPing/ios, then run:

pod install

This creates a FriendlyPing.xcworkspace file in the folder. Run the following command to open the project in xcode:

open FriendlyPing.xcworkspace

Get a configuration file for your iOS app opening the following link in a new tab: https://developers.google.com/mobile/add

To configure the project, you need to provide a valid APNs certificate and some additional information to get a configuration file and finish setting up your project. If you don't already have an APNs certificate see Provisioning APNs SSL Certificates. When prompted, provide the Bundle ID associated with your APNs certificate, and enable the following APIs:

  • Google Sign-In
  • Cloud Messaging
  • Analytics
  • AdMob

Download the GoogleService-Info.plist file to your mac, then add it to the FriendlyPingSwift target in the xcode project. To configure Google Sign-In:

  • In the Project > Target > Info > URL Types panel, create a new item and paste your REVERSED_CLIENT_ID into the URL Schemes field. You can find your REVERSED_CLIENT_ID in the GoogleService-Info.plist file.
  • Also in the Project > Target > Info > URL Types panel, create a new item and type your bundle identifier in the URL Schemes field.

Don't build and run the client until you have one of the servers running. Don't run 2 servers though :).

Go server

Read the Go server instructions to start up the Go server locally on your machine.

Java server

Read the Java server instructions to start up the Java server locally on your machine.

How to make contributions?

Please read and follow the steps in the CONTRIBUTING.md

License

See LICENSE

friendlyping's People

Contributors

aliafshar avatar jvgogh avatar keyboardsurfer avatar kroikie avatar naokigoogle avatar silvolu avatar tirodkar 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

friendlyping's Issues

Error while running

Hi,

I am getting the below error:
Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/agupta/Library/Android/sdk/build-tools/23.0.1/aapt'' finished with non-zero exit value 1

How can I resolve the issue?

n/a

I'll start by saying this could most definitely be user error. That said...

I'm receiving an error at the point where I start up my app and it attempts to send a register_new_client message to my server, which I'm running . The server responds with...

Failed broadcasting the new client: error sending request to GCM HTTP server: error unmarshaling json from body: invalid character '<' looking for beginning of value

...and this is followed shortly afterwards with...

Failed sending client list: error sending request to GCM HTTP server: error unmarshaling json from body: invalid character '<' looking for beginning of value

Any idea what's going on?

Firebase Cloud Messagingin

I know this is not a place to ask for example requests but I wanted to see if you could update this example to use Firebase messaging instead. I attempted to switch to Firebase but I ran into a few different issue with parsing the data. If by any chance you could update that sample to use Firebase messaging that would be highly appreciated. Mostly because friendlyPing also includes an XMPP server example.

Thanks for all your work.

Go server run fail (cannot use *notification)

  1. I setup golang on Mac (using official manual)
  2. Install go-gcm:
    $ go get github.com/google/go-gcm
    $ go install github.com/google/go-gcm

  1. Open friendlyPing/server/Go folder and run:

go run server.go -testData testdata/clients.json -apiKey XXXXXXXXX -senderId XXXXXXXXX

  1. Then I get:

# command-line-arguments
./server.go:174: cannot use *notification (type gcm.Notification) as type *gcm.Notification in field value

I checked that /Users/username/gocode/src/github.com/google/go-gcm exist in my workspace folder

Can you give me some directions what is need to be checked in my setup? I suggested that go do not see go-gcm package, but everything looking fine for me

"Error sending request to GCM HTTP server" when registering a new client

I'm receiving an error at the point where I start up my client app and it attempts to send a register_new_client message to my server. The Go server responds with...

Failed broadcasting the new client: error sending request to GCM HTTP server: error 
unmarshaling json from body: invalid character '<' looking for beginning of value

...and this is followed shortly afterwards with...

Failed sending client list: error sending request to GCM HTTP server: error 
unmarshaling json from body: invalid character '<' looking for beginning of value

Any idea what's going on? The client object that I'm sending across looks fairly normal, from what I can tell.

iOS Client doesn't switch to Table View after signing in initially

  1. Start up a fresh app
  2. Sign in.
  3. Your console will tell you you've been signed in, but it also won't let you switch to the Table View with all the other pingable clients.
  4. I also see a console error that looks like this: 2016-01-13 13:20:11.955 FriendlyPingSwift[1335:675208] Warning: Attempt to present <FriendlyPingSwift.FPViewController: 0x157755af0> on <SFSafariViewController: 0x1575f55d0> whose view is not in the window hierarchy!
  5. Quitting the app and restarting it works fine. I'll be signed in automatically, and I'll jump into the TableVC

I'm assuming this is because we're attempting to transition to the next view controller while the embedded SFSafariVC is still being dismissed, or something like that. Let me fiddle with it a bit and see if I can come up with a decent pull request to fix it.

nothing happened on running go server in windows

I have setup everything including running friendlyping app inside an emulator and finally running go server like this inside windows command line:

go run server.go -testData testdata/clients.json \ -apiKey "AIzaSyAgoWg26iPJGW2RpMeL-PF3WM9UT5VXXX" -senderId "263800000000"

but nothing happened. what's wrong?

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.